diff options
Diffstat (limited to 'heatclient/osc')
-rw-r--r-- | heatclient/osc/v1/stack.py | 32 | ||||
-rw-r--r-- | heatclient/osc/v1/template.py | 16 |
2 files changed, 42 insertions, 6 deletions
diff --git a/heatclient/osc/v1/stack.py b/heatclient/osc/v1/stack.py index 761b323..a25844b 100644 --- a/heatclient/osc/v1/stack.py +++ b/heatclient/osc/v1/stack.py @@ -48,6 +48,13 @@ class CreateStack(command.ShowOne): help=_('Path to the environment. Can be specified multiple times') ) parser.add_argument( + '-s', '--files-container', + metavar='<files-container>', + help=_('Swift files container name. Local files other than ' + 'root template would be ignored. If other files are not ' + 'found in swift, heat engine would raise an error.') + ) + parser.add_argument( '--timeout', metavar='<timeout>', type=int, @@ -130,13 +137,15 @@ class CreateStack(command.ShowOne): tpl_files, template = template_utils.process_template_path( parsed_args.template, - object_request=http.authenticated_fetcher(client)) + object_request=http.authenticated_fetcher(client), + fetch_child=parsed_args.files_container is None) env_files_list = [] env_files, env = ( template_utils.process_multiple_environments_and_files( env_paths=parsed_args.environment, - env_list_tracker=env_files_list)) + env_list_tracker=env_files_list, + fetch_env_files=parsed_args.files_container is None)) parameters = heat_utils.format_all_parameters( parsed_args.parameter, @@ -160,6 +169,9 @@ class CreateStack(command.ShowOne): if env_files_list: fields['environment_files'] = env_files_list + if parsed_args.files_container: + fields['files_container'] = parsed_args.files_container + if parsed_args.tags: fields['tags'] = parsed_args.tags if parsed_args.timeout: @@ -212,6 +224,13 @@ class UpdateStack(command.ShowOne): help=_('Path to the template') ) parser.add_argument( + '-s', '--files-container', + metavar='<files-container>', + help=_('Swift files container name. Local files other than ' + 'root template would be ignored. If other files are not ' + 'found in swift, heat engine would raise an error.') + ) + parser.add_argument( '-e', '--environment', metavar='<environment>', action='append', help=_('Path to the environment. Can be specified multiple times') @@ -308,13 +327,15 @@ class UpdateStack(command.ShowOne): tpl_files, template = template_utils.process_template_path( parsed_args.template, object_request=http.authenticated_fetcher(client), - existing=parsed_args.existing) + existing=parsed_args.existing, + fetch_child=parsed_args.files_container is None) env_files_list = [] env_files, env = ( template_utils.process_multiple_environments_and_files( env_paths=parsed_args.environment, - env_list_tracker=env_files_list)) + env_list_tracker=env_files_list, + fetch_env_files=parsed_args.files_container is None)) parameters = heat_utils.format_all_parameters( parsed_args.parameter, @@ -338,6 +359,9 @@ class UpdateStack(command.ShowOne): if env_files_list: fields['environment_files'] = env_files_list + if parsed_args.files_container: + fields['files_container'] = parsed_args.files_container + if parsed_args.tags: fields['tags'] = parsed_args.tags if parsed_args.timeout: diff --git a/heatclient/osc/v1/template.py b/heatclient/osc/v1/template.py index c501812..f25263e 100644 --- a/heatclient/osc/v1/template.py +++ b/heatclient/osc/v1/template.py @@ -123,6 +123,13 @@ class Validate(format_utils.YamlFormat): 'specified multiple times') ) parser.add_argument( + '-s', '--files-container', + metavar='<files-container>', + help=_('Swift files container name. Local files other than ' + 'root template would be ignored. If other files are not ' + 'found in swift, heat engine would raise an error.') + ) + parser.add_argument( '--ignore-errors', metavar='<error1,error2,...>', help=_('List of heat errors to ignore') @@ -145,11 +152,13 @@ class Validate(format_utils.YamlFormat): def _validate(heat_client, args): tpl_files, template = template_utils.process_template_path( args.template, - object_request=http.authenticated_fetcher(heat_client)) + object_request=http.authenticated_fetcher(heat_client), + fetch_child=args.files_container is None) env_files_list = [] env_files, env = template_utils.process_multiple_environments_and_files( - env_paths=args.environment, env_list_tracker=env_files_list) + env_paths=args.environment, env_list_tracker=env_files_list, + fetch_env_files=args.files_container is None) fields = { 'template': template, @@ -168,6 +177,9 @@ def _validate(heat_client, args): if args.show_nested: fields['show_nested'] = args.show_nested + if args.files_container: + fields['files_container'] = args.files_container + validation = heat_client.stacks.validate(**fields) data = list(six.itervalues(validation)) columns = list(six.iterkeys(validation)) |