Merge "Revert "Update machine and switch db api to send task to specific queues.""
This commit is contained in:
commit
2d4e696ed2
@ -228,10 +228,7 @@ def poweron_machine(
|
|||||||
)
|
)
|
||||||
celery_client.celery.send_task(
|
celery_client.celery.send_task(
|
||||||
'compass.tasks.poweron_machine',
|
'compass.tasks.poweron_machine',
|
||||||
(machine_id,),
|
(machine_id,)
|
||||||
queue=user.email,
|
|
||||||
exchange=user.email,
|
|
||||||
routing_key=user.email
|
|
||||||
)
|
)
|
||||||
return {
|
return {
|
||||||
'status': 'poweron %s action sent' % machine.mac,
|
'status': 'poweron %s action sent' % machine.mac,
|
||||||
@ -258,10 +255,7 @@ def poweroff_machine(
|
|||||||
)
|
)
|
||||||
celery_client.celery.send_task(
|
celery_client.celery.send_task(
|
||||||
'compass.tasks.poweroff_machine',
|
'compass.tasks.poweroff_machine',
|
||||||
(machine_id,),
|
(machine_id,)
|
||||||
queue=user.email,
|
|
||||||
exchange=user.email,
|
|
||||||
routing_key=user.email
|
|
||||||
)
|
)
|
||||||
return {
|
return {
|
||||||
'status': 'poweroff %s action sent' % machine.mac,
|
'status': 'poweroff %s action sent' % machine.mac,
|
||||||
@ -288,10 +282,7 @@ def reset_machine(
|
|||||||
)
|
)
|
||||||
celery_client.celery.send_task(
|
celery_client.celery.send_task(
|
||||||
'compass.tasks.reset_machine',
|
'compass.tasks.reset_machine',
|
||||||
(machine_id,),
|
(machine_id,)
|
||||||
queue=user.email,
|
|
||||||
exchange=user.email,
|
|
||||||
routing_key=user.email
|
|
||||||
)
|
)
|
||||||
return {
|
return {
|
||||||
'status': 'reset %s action sent' % machine.mac,
|
'status': 'reset %s action sent' % machine.mac,
|
||||||
|
@ -838,10 +838,7 @@ def poll_switch(switch_id, user=None, session=None, **kwargs):
|
|||||||
switch = _get_switch(switch_id, session=session)
|
switch = _get_switch(switch_id, session=session)
|
||||||
celery_client.celery.send_task(
|
celery_client.celery.send_task(
|
||||||
'compass.tasks.pollswitch',
|
'compass.tasks.pollswitch',
|
||||||
(user.email, switch.ip, switch.credentials),
|
(user.email, switch.ip, switch.credentials)
|
||||||
queue=user.email,
|
|
||||||
exchange=user.email,
|
|
||||||
routing_key=user.email
|
|
||||||
)
|
)
|
||||||
return {
|
return {
|
||||||
'status': 'action %s sent' % kwargs,
|
'status': 'action %s sent' % kwargs,
|
||||||
|
@ -7,6 +7,3 @@ BROKER_URL = "amqp://guest:guest@localhost:5672//"
|
|||||||
CELERY_IMPORTS=("compass.tasks.tasks",)
|
CELERY_IMPORTS=("compass.tasks.tasks",)
|
||||||
CELERY_ACCEPT_CONTENT = ['pickle', 'json', 'msgpack', 'yaml']
|
CELERY_ACCEPT_CONTENT = ['pickle', 'json', 'msgpack', 'yaml']
|
||||||
C_FORCE_ROOT = 1
|
C_FORCE_ROOT = 1
|
||||||
CELERY_DEFAULT_QUEUE = 'admin@huawei.com'
|
|
||||||
CELERY_DEFAULT_EXCHANGE = 'admin@huawei.com'
|
|
||||||
CELERY_DEFAULT_ROUTING_KEY = 'admin@huawei.com'
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user