Use only update/upgrade ansible queue instead
Related tripleo-common change: https://review.openstack.org/562995 To avoid race between tripleo queue and ansible queue we need to use inly ansible queue for update and upgrade Change-Id: I39b5a1a154b10683ac0de85afd6bbadc3491192a
This commit is contained in:
parent
8d26f89ebd
commit
3b197c0991
|
@ -79,28 +79,19 @@ def update_ansible(clients, **workflow_input):
|
||||||
tripleoclients = clients.tripleoclient
|
tripleoclients = clients.tripleoclient
|
||||||
ansible_queue = workflow_input['ansible_queue_name']
|
ansible_queue = workflow_input['ansible_queue_name']
|
||||||
|
|
||||||
with tripleoclients.messaging_websocket() as ws:
|
with tripleoclients.messaging_websocket(ansible_queue) as update_ws:
|
||||||
execution = base.start_workflow(
|
execution = base.start_workflow(
|
||||||
workflow_client,
|
workflow_client,
|
||||||
'tripleo.package_update.v1.update_nodes',
|
'tripleo.package_update.v1.update_nodes',
|
||||||
workflow_input=workflow_input
|
workflow_input=workflow_input
|
||||||
)
|
)
|
||||||
|
|
||||||
with tripleoclients.messaging_websocket(ansible_queue) as update_ws:
|
for payload in base.wait_for_messages(workflow_client,
|
||||||
for payload in base.wait_for_messages(workflow_client,
|
update_ws,
|
||||||
update_ws,
|
execution):
|
||||||
execution):
|
|
||||||
# Need to sleep a little, to let the time for the execution
|
|
||||||
# to get the right status in between. It avoid to fall in the
|
|
||||||
# while True loop to get messages
|
|
||||||
time.sleep(5)
|
|
||||||
if payload.get('message'):
|
if payload.get('message'):
|
||||||
pprint.pprint(payload['message'].splitlines())
|
pprint.pprint(payload['message'].splitlines())
|
||||||
|
|
||||||
for payload in base.wait_for_messages(workflow_client, ws, execution):
|
|
||||||
if payload.get('message'):
|
|
||||||
print(payload)
|
|
||||||
|
|
||||||
if payload['status'] == 'SUCCESS':
|
if payload['status'] == 'SUCCESS':
|
||||||
print('Success')
|
print('Success')
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue