From 125154e5a435121168c5dc59cf32d6e523ac6c28 Mon Sep 17 00:00:00 2001 From: chigang Date: Fri, 1 Jul 2016 01:43:42 +0000 Subject: [PATCH] Revert "Update machine and switch db api to send task to specific queues." This reverts commit 64daaeb3a785416c40ca320a8ad5afbaed9cc8e0. Change-Id: Ibf0cc7c583cd622e3325546c7e7430086f67ac2b --- compass/db/api/machine.py | 15 +++------------ compass/db/api/switch.py | 5 +---- conf/celeryconfig | 3 --- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/compass/db/api/machine.py b/compass/db/api/machine.py index 5e724f5a..9a8d3eac 100644 --- a/compass/db/api/machine.py +++ b/compass/db/api/machine.py @@ -228,10 +228,7 @@ def poweron_machine( ) celery_client.celery.send_task( 'compass.tasks.poweron_machine', - (machine_id,), - queue=user.email, - exchange=user.email, - routing_key=user.email + (machine_id,) ) return { 'status': 'poweron %s action sent' % machine.mac, @@ -258,10 +255,7 @@ def poweroff_machine( ) celery_client.celery.send_task( 'compass.tasks.poweroff_machine', - (machine_id,), - queue=user.email, - exchange=user.email, - routing_key=user.email + (machine_id,) ) return { 'status': 'poweroff %s action sent' % machine.mac, @@ -288,10 +282,7 @@ def reset_machine( ) celery_client.celery.send_task( 'compass.tasks.reset_machine', - (machine_id,), - queue=user.email, - exchange=user.email, - routing_key=user.email + (machine_id,) ) return { 'status': 'reset %s action sent' % machine.mac, diff --git a/compass/db/api/switch.py b/compass/db/api/switch.py index f3e27ebc..4c7c8e59 100644 --- a/compass/db/api/switch.py +++ b/compass/db/api/switch.py @@ -838,10 +838,7 @@ def poll_switch(switch_id, user=None, session=None, **kwargs): switch = _get_switch(switch_id, session=session) celery_client.celery.send_task( 'compass.tasks.pollswitch', - (user.email, switch.ip, switch.credentials), - queue=user.email, - exchange=user.email, - routing_key=user.email + (user.email, switch.ip, switch.credentials) ) return { 'status': 'action %s sent' % kwargs, diff --git a/conf/celeryconfig b/conf/celeryconfig index f23858ba..f4911279 100644 --- a/conf/celeryconfig +++ b/conf/celeryconfig @@ -7,6 +7,3 @@ BROKER_URL = "amqp://guest:guest@localhost:5672//" CELERY_IMPORTS=("compass.tasks.tasks",) CELERY_ACCEPT_CONTENT = ['pickle', 'json', 'msgpack', 'yaml'] C_FORCE_ROOT = 1 -CELERY_DEFAULT_QUEUE = 'admin@huawei.com' -CELERY_DEFAULT_EXCHANGE = 'admin@huawei.com' -CELERY_DEFAULT_ROUTING_KEY = 'admin@huawei.com'