Support --show-nested in openstack stack update --dry-run
Added --show-nested support in `openstack stack update`.
The work is based on `heat stack-update` implementation.
Closes-Bug:
MODIFY
heatclient/osc/v1/stack.py
heatclient/osc/v1/stack.py
@@ -232,6 +232,10 @@ class UpdateStack(command.ShowOne):
help=_('Do not actually perform the stack update, but show what '
'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. '
@@ -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',

MODIFY
heatclient/tests/unit/osc/v1/test_stack.py
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'))

Support --show-nested in openstack stack update --dry-run

  Added --show-nested support in `openstack stack update`.
  The work is based on `heat stack-update` implementation.

Closes-Bug: #1720085
Change-Id: I50c8f5ac9ba4cb7e478af03ff4c1f099270ae226