Fix getting action id in Location header

openstacksdk was changed to return action object with id inside for API
calls that have location in response header.

This change retrieves the action id from the action object returned when
calling cluster delete and node delete.

Depends-On: https://review.openstack.org/#/c/631362/
Change-Id: Ife9d3be5acd740f6de7721ba54aa87d44f924728
Closes-Bug: #1814171
This commit is contained in:
Duc Truong 2019-01-31 21:46:51 +00:00
parent 1c9e7078f3
commit 380ebb797a
2 changed files with 4 additions and 4 deletions

View File

@ -358,9 +358,9 @@ class DeleteCluster(command.Command):
result = {}
for cid in parsed_args.cluster:
try:
cluster = senlin_client.delete_cluster(
cluster_delete_action = senlin_client.delete_cluster(
cid, False, parsed_args.force_delete)
result[cid] = ('OK', cluster.location.split('/')[-1])
result[cid] = ('OK', cluster_delete_action['id'])
except Exception as ex:
result[cid] = ('ERROR', six.text_type(ex))

View File

@ -329,9 +329,9 @@ class DeleteNode(command.Command):
result = {}
for nid in parsed_args.node:
try:
node = senlin_client.delete_node(
node_delete_action = senlin_client.delete_node(
nid, False, parsed_args.force_delete)
result[nid] = ('OK', node.location.split('/')[-1])
result[nid] = ('OK', node_delete_action['id'])
except Exception as ex:
result[nid] = ('ERROR', six.text_type(ex))