Merge "Add `--converge` argument for osc stack update"

This commit is contained in:
Zuul 2017-12-01 00:43:44 +00:00 committed by Gerrit Code Review
commit 18d3e992da
3 changed files with 26 additions and 0 deletions

View File

@ -282,6 +282,11 @@ class UpdateStack(command.ShowOne):
help=_('Wait until stack goes to UPDATE_COMPLETE or '
'UPDATE_FAILED')
)
parser.add_argument(
'--converge',
action='store_true',
help=_('Stack update with observe on reality.')
)
return parser
@ -361,6 +366,9 @@ class UpdateStack(command.ShowOne):
limit=1)
marker = events[0].id if events else None
if parsed_args.converge:
fields['converge'] = True
client.stacks.update(**fields)
if parsed_args.wait:

View File

@ -304,6 +304,16 @@ class TestStackUpdate(TestStack):
self.stack_client.update.assert_called_with(**kwargs)
def test_stack_update_converge(self):
arglist = ['my_stack', '-t', self.template_path, '--converge']
kwargs = copy.deepcopy(self.defaults)
kwargs['converge'] = True
parsed_args = self.check_parser(self.cmd, arglist, [])
self.cmd.take_action(parsed_args)
self.stack_client.update.assert_called_with(**kwargs)
def test_stack_update_pre_update(self):
arglist = ['my_stack', '-t', self.template_path, '--pre-update', 'a']
kwargs = copy.deepcopy(self.defaults)

View File

@ -0,0 +1,8 @@
---
features:
- Adds '--converge' option for stack update with openstackclient. If
specified, existing resource attributes (which may have diverged) are
compared with the resource properties in the template used for update.
Usage:
# openstack stack update --converge ... <stack_name>