From b437ad5227b97dbdfa079f8c1dc98fe6a94847cd Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Thu, 1 Sep 2016 15:24:34 +0200 Subject: [PATCH] TT#1735 repoapi: fix send_task() args * add 'shell' rule to Makefile for prod > Traceback (most recent call last): > File "/var/lib/repoapi/venv_prod/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task > R = retval = fun(*args, **kwargs) > File "/var/lib/repoapi/venv_prod/local/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__ > return self.run(*args, **kwargs) > File "/usr/share/repoapi/repoapi/celery.py", line 35, in jbi_parse_hotfix > app.send_task('hotfix_released', args=[jbi_id, path]) > File "/var/lib/repoapi/venv_prod/local/lib/python2.7/site-packages/celery/app/base.py", line 354, in send_task > reply_to=reply_to or self.oid, **options > File "/var/lib/repoapi/venv_prod/local/lib/python2.7/site-packages/celery/app/amqp.py", line 255, in publish_task > raise ValueError('task args must be a list or tuple') > ValueError: task args must be a list or tuple Change-Id: Id1ccea3665a8face98e31608e2cd5a30acb4eaea --- Makefile | 4 ++++ repoapi/celery.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1192978..443aaa3 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,10 @@ migrate: venv_prod ./manage.py migrate --settings="repoapi.settings.prod" chown www-data:www-data $(VAR_DIR)/db.sqlite3 +shell_dev: venv_prod + source $(VAR_DIR)/venv_prod/bin/activate && \ + ./manage.py shell --settings="repoapi.settings.prod" + ################################### run_dev: diff --git a/repoapi/celery.py b/repoapi/celery.py index f5303a4..42a7e35 100644 --- a/repoapi/celery.py +++ b/repoapi/celery.py @@ -32,4 +32,4 @@ app.autodiscover_tasks(lambda: settings.INSTALLED_APPS) @app.task() def jbi_parse_hotfix(jbi_id, path): - app.send_task('hotfix_released', jbi_id, path) + app.send_task('hotfix_released', args=[jbi_id, path])