Reputation: 10058
I'm using Celery v3.1.19 to execute a task, this task calls a function and one of the parameters is a dictionary. I always get this error when bind=True:
[2016-01-03 09:33:41,883: ERROR/MainProcess] Task hypervisor.esxi.deploy_esx.imbue_esx[21A2B368B2] raised unexpected: TypeError("imbue_esx() got multiple values for keyword argument 'configuration'",)
Traceback (most recent call last):
File "/Users/gogasca/Documents/OpenSource/Development/Python/IMBUExApp/venv/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
R = retval = fun(*args, **kwargs)
File "/Users/gogasca/Documents/OpenSource/Development/Python/IMBUExApp/venv/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__
return self.run(*args, **kwargs)
TypeError: imbue_esx() got multiple values for keyword argument 'configuration'
When I look at the function imbue_esx Is defined like this:
@task(bind=True)
def imbue_esx(
configuration={},
job="1",
api_call=False,
cli=False,
manual_mode=False,
log_file="",
**kwargs):
This is how Im sending this task:
celery.send_task("hypervisor.esxi.deploy_esx.imbue_esx",
kwargs={'configuration': configuration,
'job':job_ref,
'api_call': True },
task_id=job_ref)
I have tried calling imbue_esx like this:
celery.send_task("hypervisor.esxi.deploy_esx.imbue_esx",
kwargs={'configuration': configuration,
'job':job_ref,
'api_call': True,
'cli': False,
'manual_mode': False,
'log_file': ""},
and even removing **kwargs
from imbue_esx
, but always get the same error. Any ideas?
DEBUG
[2016-01-03 09:33:41,821: INFO/MainProcess] Received task: hypervisor.esxi.deploy_esx.imbue_esx[21A2B368B2]
[2016-01-03 09:33:41,821: DEBUG/MainProcess] TaskPool: Apply <function _fast_trace_task at 0x10fa219b0> (args:('hypervisor.esxi.deploy_esx.imbue_esx', '21A2B368B2', [], {'job': '21A2B368B2', 'api_call': True, 'job_id': 236, 'configuration': {'host': {u'hypervisor': {u'username': u'root', u'vnc': u'5900:5909', u'name': u'esx-milpitas', u'ip': u'110.10.0.144', u'discover': True, u'sync': True, u'ssh': 22, u'https': 443, u'password': u'password', u'type': u'esxi', u'owner_id': 1}, u'db': True}}}, {'utc': True, u'is_eager': False, 'chord': None, u'group': None, 'args': [], 'retries': 0, u'delivery_info': {u'priority': 0, u'redelivered': False, u'routing_key': u'celery', u'exchange': u'celery'}, 'expires': None, u'hostname': '[email protected]', 'task': 'hypervisor.esxi.deploy_esx.imbue_esx', 'callbacks': None, u'correlation_id': u'21A2B368B2', 'errbacks': None, 'timelimit': (None, None), 'taskset': None, 'kwargs': {'job': '21A2B368B2', 'api_call': True, 'job_id': 236, 'configuration': {'host': {u'hypervisor': {u'username': u'root', u'vnc': u'5900:5909', u'name': u'esx-milpitas', u'ip': u'110.10.0.144', u'discover':... kwargs:{})
Upvotes: 0
Views: 1768
Reputation: 10058
I upgraded to v3.1.19 and added self parameter to function imbue_esx.
Upvotes: 1