Add shell arguments for stack update

add option timeout for do_update,which has been added
for do_stack_update already.

add option rollback for stack update, this is supported
already in heat[1].

[1]7c833ecc2b

Change-Id: I4545aef556c4c3297c2993418df2ec2cd7c4e408
Partial-Bug: #1324366
This commit is contained in:
Zhang Yang 2014-05-16 19:42:04 -07:00 committed by Zhang Yang
parent 5a78fdf4ec
commit 83d9485f31
2 changed files with 11 additions and 1 deletions

View File

@ -818,7 +818,8 @@ class ShellTestUserPass(ShellBase):
'LinuxDistribution': 'F17"',
'"InstanceType': 'm1.large',
'DBPassword': 'verybadpassword'},
'timeout_mins': 123}
'timeout_mins': 123,
'disable_rollback': True}
http.HTTPClient.json_request(
'PUT', '/stacks/teststack2/2',
data=expected_data,
@ -997,6 +998,7 @@ class ShellTestUserPass(ShellBase):
update_text = self.shell(
'stack-update teststack2/2 '
'--template-file=%s '
'--enable-rollback '
'--parameters="InstanceType=m1.large;DBUsername=wp;'
'DBPassword=verybadpassword;KeyName=heat_key;'
'LinuxDistribution=F17"' % template_file)

View File

@ -329,6 +329,11 @@ def do_stack_show(hc, args):
help='URL of template.')
@utils.arg('-o', '--template-object', metavar='<URL>',
help='URL to retrieve template object (e.g. from swift).')
@utils.arg('-t', '--timeout', metavar='<TIMEOUT>',
type=int,
help='Stack update timeout in minutes.')
@utils.arg('-r', '--enable-rollback', default=False, action="store_true",
help='Enable rollback on create/update failure.')
@utils.arg('-P', '--parameters', metavar='<KEY1=VALUE1;KEY2=VALUE2...>',
help='Parameter values used to create the stack. '
'This can be specified multiple times, or once with parameters '
@ -353,6 +358,8 @@ def do_update(hc, args):
@utils.arg('-t', '--timeout', metavar='<TIMEOUT>',
type=int,
help='Stack update timeout in minutes.')
@utils.arg('-r', '--enable-rollback', default=False, action="store_true",
help='Enable rollback on create/update failure.')
@utils.arg('-P', '--parameters', metavar='<KEY1=VALUE1;KEY2=VALUE2...>',
help='Parameter values used to create the stack. '
'This can be specified multiple times, or once with parameters '
@ -374,6 +381,7 @@ def do_stack_update(hc, args):
fields = {
'stack_id': args.id,
'disable_rollback': not(args.enable_rollback),
'parameters': utils.format_parameters(args.parameters),
'template': template,
'files': dict(list(tpl_files.items()) + list(env_files.items())),