From 280b1edeeab3a9746ec6674d23fb7ea95b4b46fc Mon Sep 17 00:00:00 2001 From: rabi Date: Wed, 30 Nov 2016 09:01:34 +0530 Subject: User server side env merging with osc plugin With osc client plugin, we don't seem to use server side env merging for stack create and update. However, it's there for template validation. This patch brings it in sync with heat cli. Change-Id: I8973fa499c51ca5f789efa6fb5c07bb6302324d7 Related-Bug: #1645686 --- heatclient/osc/v1/stack.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'heatclient/osc') diff --git a/heatclient/osc/v1/stack.py b/heatclient/osc/v1/stack.py index 6787f1c..719c0de 100644 --- a/heatclient/osc/v1/stack.py +++ b/heatclient/osc/v1/stack.py @@ -124,9 +124,11 @@ class CreateStack(command.ShowOne): parsed_args.template, object_request=http.authenticated_fetcher(client)) + env_files_list = [] env_files, env = ( template_utils.process_multiple_environments_and_files( - env_paths=parsed_args.environment)) + env_paths=parsed_args.environment, + env_list_tracker=env_files_list)) parameters = heat_utils.format_all_parameters( parsed_args.parameter, @@ -146,6 +148,10 @@ class CreateStack(command.ShowOne): 'environment': env } + # If one or more environments is found, pass the listing to the server + if env_files_list: + fields['environment_files'] = env_files_list + if parsed_args.tags: fields['tags'] = parsed_args.tags if parsed_args.timeout: @@ -286,9 +292,11 @@ class UpdateStack(command.ShowOne): object_request=http.authenticated_fetcher(client), existing=parsed_args.existing) + env_files_list = [] env_files, env = ( template_utils.process_multiple_environments_and_files( - env_paths=parsed_args.environment)) + env_paths=parsed_args.environment, + env_list_tracker=env_files_list)) parameters = heat_utils.format_all_parameters( parsed_args.parameter, @@ -308,6 +316,10 @@ class UpdateStack(command.ShowOne): 'environment': env } + # If one or more environments is found, pass the listing to the server + if env_files_list: + fields['environment_files'] = env_files_list + if parsed_args.tags: fields['tags'] = parsed_args.tags if parsed_args.timeout: -- cgit v1.2.1