diff options
Diffstat (limited to 'heatclient/v1')
-rw-r--r-- | heatclient/v1/shell.py | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/heatclient/v1/shell.py b/heatclient/v1/shell.py index cefe368..ae55cdb 100644 --- a/heatclient/v1/shell.py +++ b/heatclient/v1/shell.py @@ -53,6 +53,7 @@ logger = logging.getLogger(__name__) help='Name of the stack to create.') def do_create(hc, args): '''DEPRECATED! Use stack-create instead.''' + logger.warning('DEPRECATED! Use stack-create instead.') do_stack_create(hc, args) @@ -96,7 +97,6 @@ def do_stack_create(hc, args): fields = { 'stack_name': args.name, - 'timeout_mins': args.timeout or args.create_timeout, 'disable_rollback': not(args.enable_rollback), 'parameters': utils.format_parameters(args.parameters), 'template': template, @@ -104,6 +104,10 @@ def do_stack_create(hc, args): 'environment': env } + timeout = args.timeout or args.create_timeout + if timeout: + fields['timeout_mins'] = timeout + hc.stacks.create(**fields) do_stack_list(hc) @@ -156,7 +160,6 @@ def do_stack_adopt(hc, args): fields = { 'stack_name': args.name, - 'timeout_mins': args.timeout or args.create_timeout, 'disable_rollback': not(args.enable_rollback), 'adopt_stack_data': adopt_data, 'parameters': utils.format_parameters(args.parameters), @@ -165,6 +168,10 @@ def do_stack_adopt(hc, args): 'environment': env } + timeout = args.timeout or args.create_timeout + if timeout: + fields['timeout_mins'] = timeout + hc.stacks.create(**fields) do_stack_list(hc) @@ -201,14 +208,16 @@ def do_stack_preview(hc, args): fields = { 'stack_name': args.name, - 'timeout_mins': args.create_timeout, 'disable_rollback': not(args.enable_rollback), 'parameters': utils.format_parameters(args.parameters), 'template': template, - 'files': dict(tpl_files.items() + env_files.items()), + 'files': dict(list(tpl_files.items()) + list(env_files.items())), 'environment': env } + if args.create_timeout: + fields['timeout_mins'] = args.create_timeout + stack = hc.stacks.preview(**fields) formatters = { 'description': utils.text_wrap_formatter, @@ -226,6 +235,7 @@ def do_stack_preview(hc, args): help='Name or ID of stack(s) to delete.') def do_delete(hc, args): '''DEPRECATED! Use stack-delete instead.''' + logger.warning('DEPRECATED! Use stack-delete instead.') do_stack_delete(hc, args) @@ -290,6 +300,7 @@ def do_action_resume(hc, args): help='Name or ID of stack to describe.') def do_describe(hc, args): '''DEPRECATED! Use stack-show instead.''' + logger.warning('DEPRECATED! Use stack-show instead.') do_stack_show(hc, args) @@ -331,6 +342,7 @@ def do_stack_show(hc, args): help='Name or ID of stack to update.') def do_update(hc, args): '''DEPRECATED! Use stack-update instead.''' + logger.warning('DEPRECATED! Use stack-update instead.') do_stack_update(hc, args) @@ -381,6 +393,7 @@ def do_stack_update(hc, args): def do_list(hc, args=None): '''DEPRECATED! Use stack-list instead.''' + logger.warning('DEPRECATED! Use stack-list instead.') do_stack_list(hc) @@ -403,7 +416,7 @@ def do_stack_list(hc, args=None): stacks = hc.stacks.list(**kwargs) fields = ['id', 'stack_name', 'stack_status', 'creation_time'] - utils.print_list(stacks, fields, sortby=3) + utils.print_list(stacks, fields, sortby_index=3) @utils.arg('id', metavar='<NAME or ID>', @@ -450,7 +463,7 @@ def do_resource_type_list(hc, args={}): '''List the available resource types.''' kwargs = {} types = hc.resource_types.list(**kwargs) - utils.print_list(types, ['resource_type'], sortby=0) + utils.print_list(types, ['resource_type'], sortby_index=0) @utils.arg('resource_type', metavar='<RESOURCE_TYPE>', @@ -470,6 +483,7 @@ def do_resource_type_show(hc, args={}): help='Name or ID of stack to get the template for.') def do_gettemplate(hc, args): '''DEPRECATED! Use template-show instead.''' + logger.warning('DEPRECATED! Use template-show instead.') do_template_show(hc, args) @@ -504,6 +518,7 @@ def do_template_show(hc, args): action='append') def do_validate(hc, args): '''DEPRECATED! Use template-validate instead.''' + logger.warning('DEPRECATED! Use template-validate instead.') do_template_validate(hc, args) @@ -559,7 +574,7 @@ def do_resource_list(hc, args): else: fields.insert(0, 'logical_resource_id') - utils.print_list(resources, fields, sortby=3) + utils.print_list(resources, fields, sortby_index=3) @utils.arg('id', metavar='<NAME or ID>', @@ -568,6 +583,7 @@ def do_resource_list(hc, args): help='Name of the resource to show the details for.') def do_resource(hc, args): '''DEPRECATED! Use resource-show instead.''' + logger.warning('DEPRECATED! Use resource-show instead.') do_resource_show(hc, args) @@ -697,6 +713,7 @@ def do_event_list(hc, args): help='ID of event to display details for.') def do_event(hc, args): '''DEPRECATED! Use event-show instead.''' + logger.warning('DEPRECATED! Use event-show instead.') do_event_show(hc, args) |