[Freeswitch-users] Issue with mod_python - exceptions.AttributeError

davy davy.van.de.moere at gmail.com
Tue Mar 4 17:19:21 MSK 2014


Gents,

I’m a big fan of mod_python, as it gives a lot of liberty in handling the calls. However, I tried to tie in Celery to the mix, and I’m getting a nasty error. I’m loading the test.py script using the application python in the dialplan.

I also tried an alternative to celery, Kuyruk, but that was the exact same problem.

Am I trying to push mod_python over the barrier it was meant for? Or am I just doing something not as it should? Ps, I noticed in the mailinglist you want to improve the mod_python documentation! I’ld be happy to help where I can.



Some excerpts of the cli and code:


2014-03-04 14:58:31.269345 [ERR] mod_python.c:231 Error importing module
2014-03-04 14:58:31.269345 [ERR] mod_python.c:164 Python Error by calling script „test": <type 'exceptions.AttributeError'>
Message: 'module' object has no attribute 'argv'
Exception: None

Traceback (most recent call last)
	File: "/usr/local/freeswitch/scripts/test.py", line 1, in <module>
	File: "/usr/local/freeswitch/scripts/tasks.py", line 1, in <module>
	File: "/usr/local/lib/python2.7/dist-packages/celery/__init__.py", line 106, in <module>



test.py:

from tasks import add_together

def fsapi(session, stream, env, args):
       pass

tasks.py:

from celery import Celery

celery = Celery('tut1', broker='redis://localhost:6379',backend='redis://localhost:6379')

@celery.task()
def add_together(a, b):
    print(a + b)
    return(a+b)

Thx!
Davy


Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list