Revert "Update machine and switch db api to send task to specific queues."

This reverts commit 64daaeb3a7.

Change-Id: Ibf0cc7c583cd622e3325546c7e7430086f67ac2b
This commit is contained in:
chigang 2016-07-01 01:43:42 +00:00
parent 64daaeb3a7
commit 125154e5a4
3 changed files with 4 additions and 19 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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'