diff options
author | rabi <ramishra@redhat.com> | 2017-08-24 12:10:41 +0530 |
---|---|---|
committer | rabi <ramishra@redhat.com> | 2017-11-08 08:14:48 +0530 |
commit | f0d3d9f1f9380f632e5fd2a66941eb58f79c797b (patch) | |
tree | 41102d60968137a119f914327daecef9894c8934 /heatclient/osc | |
parent | 187fc54249982d2f7213c750d98c6602a08b758b (diff) | |
download | python-heatclient-f0d3d9f1f9380f632e5fd2a66941eb58f79c797b.tar.gz |
Allow cancelling create_in_progress stacks with --no-rollback
Change-Id: Ib107c82f341f4d271859ca7681d65f7ce4c5d0b1
Related-Bug: #1709041
Diffstat (limited to 'heatclient/osc')
-rw-r--r-- | heatclient/osc/v1/stack.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/heatclient/osc/v1/stack.py b/heatclient/osc/v1/stack.py index e4148d1..cb685dd 100644 --- a/heatclient/osc/v1/stack.py +++ b/heatclient/osc/v1/stack.py @@ -1215,6 +1215,7 @@ class CancelStack(StackActionBase): Supported tasks for cancellation: * update + * create """ log = logging.getLogger(__name__ + '.CancelStack') @@ -1245,17 +1246,18 @@ class CancelStack(StackActionBase): heat_client = self.app.client_manager.orchestration if parsed_args.no_rollback: action = heat_client.actions.cancel_without_rollback + allowed_statuses = ['create_in_progress', + 'update_in_progress'] else: action = heat_client.actions.cancel_update + allowed_statuses = ['update_in_progress'] for stack in parsed_args.stack: try: data = heat_client.stacks.get(stack_id=stack) except heat_exc.HTTPNotFound: raise exc.CommandError('Stack not found: %s' % stack) - status = getattr(data, 'stack_status').lower() - if status == 'update_in_progress': - + if status in allowed_statuses: data = _stack_action( stack, parsed_args, |