From da0da4c1afc00dd2732b678b09fc2d826137a44d Mon Sep 17 00:00:00 2001 From: rabi Date: Thu, 25 Aug 2016 11:01:24 +0530 Subject: Add parameter_merge_startegies section This adds parameter_merge_strategies section to environment. This also adds the missing section parameter_encrypted_names. We use a server side module and a client side module that have deviated over a period of time. This patch syncs them. We probably should move these to a library and use use them for both server and client in the future. Change-Id: I9b20a7cedd416b6d8b788a30f66e472b85babf4a Blueprint: environment-merging --- heatclient/common/environment_format.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'heatclient/common/environment_format.py') diff --git a/heatclient/common/environment_format.py b/heatclient/common/environment_format.py index 6870b79..8f2c4ea 100644 --- a/heatclient/common/environment_format.py +++ b/heatclient/common/environment_format.py @@ -17,9 +17,13 @@ from heatclient.openstack.common._i18n import _ SECTIONS = ( - PARAMETER_DEFAULTS, PARAMETERS, RESOURCE_REGISTRY, EVENT_SINKS + PARAMETER_DEFAULTS, PARAMETERS, RESOURCE_REGISTRY, + ENCRYPTED_PARAM_NAMES, EVENT_SINKS, + PARAMETER_MERGE_STRATEGIES ) = ( - 'parameter_defaults', 'parameters', 'resource_registry', 'event_sinks' + 'parameter_defaults', 'parameters', 'resource_registry', + 'encrypted_param_names', 'event_sinks', + 'parameter_merge_strategies' ) @@ -55,7 +59,9 @@ def parse(env_str): def default_for_missing(env): """Checks a parsed environment for missing sections.""" - for param in SECTIONS: - if param not in env: - env[param] = {} + if param not in env and param != PARAMETER_MERGE_STRATEGIES: + if param in (ENCRYPTED_PARAM_NAMES, EVENT_SINKS): + env[param] = [] + else: + env[param] = {} -- cgit v1.2.1