summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-09-28 10:32:38 +0000
committerGerrit Code Review <review@openstack.org>2017-09-28 10:32:38 +0000
commitbfa77b57c682005ec4c5fd28e02042d2130ed703 (patch)
treeac9f50de6476bdfc50eb747c9cac464acf4aad6b
parent4661e4d696ec1218de7abc924f21c65e8ad15191 (diff)
parent2a39275ec3cbd44cd12b46b90db5d249a762a164 (diff)
downloadpython-heatclient-bfa77b57c682005ec4c5fd28e02042d2130ed703.tar.gz
Merge "Support --show-nested in openstack stack update --dry-run"
-rw-r--r--heatclient/osc/v1/stack.py7
-rw-r--r--heatclient/tests/unit/osc/v1/test_stack.py11
2 files changed, 18 insertions, 0 deletions
diff --git a/heatclient/osc/v1/stack.py b/heatclient/osc/v1/stack.py
index 7206e71..d0b97e0 100644
--- a/heatclient/osc/v1/stack.py
+++ b/heatclient/osc/v1/stack.py
@@ -233,6 +233,10 @@ class UpdateStack(command.ShowOne):
'would be changed')
)
parser.add_argument(
+ '--show-nested', default=False, action="store_true",
+ help=_('Show nested stacks when performing --dry-run')
+ )
+ parser.add_argument(
'--parameter', metavar='<key=value>',
help=_('Parameter values used to create the stack. '
'This can be specified multiple times'),
@@ -335,6 +339,9 @@ class UpdateStack(command.ShowOne):
fields['disable_rollback'] = rollback == 'disabled'
if parsed_args.dry_run:
+ if parsed_args.show_nested:
+ fields['show_nested'] = parsed_args.show_nested
+
changes = client.stacks.preview_update(**fields)
fields = ['state', 'resource_name', 'resource_type',
diff --git a/heatclient/tests/unit/osc/v1/test_stack.py b/heatclient/tests/unit/osc/v1/test_stack.py
index 54fe9be..159056a 100644
--- a/heatclient/tests/unit/osc/v1/test_stack.py
+++ b/heatclient/tests/unit/osc/v1/test_stack.py
@@ -335,6 +335,17 @@ class TestStackUpdate(TestStack):
self.stack_client.preview_update.assert_called_with(**self.defaults)
self.stack_client.update.assert_not_called()
+ def test_stack_update_dry_run_show_nested(self):
+ arglist = ['my_stack', '-t', self.template_path, '--dry-run',
+ '--show-nested']
+ parsed_args = self.check_parser(self.cmd, arglist, [])
+
+ self.cmd.take_action(parsed_args)
+
+ self.stack_client.preview_update.assert_called_with(
+ show_nested=True, **self.defaults)
+ self.stack_client.update.assert_not_called()
+
@mock.patch('heatclient.common.event_utils.poll_for_events',
return_value=('UPDATE_COMPLETE',
'Stack my_stack UPDATE_COMPLETE'))