aboutsummaryrefslogtreecommitdiffstats
path: root/ice_validator/tests/test_environment_file_parameters.py
diff options
context:
space:
mode:
authorLovett, Trevor <trevor.lovett@att.com>2019-08-27 12:40:36 -0500
committerLovett, Trevor (tl2972) <tl2972@att.com>2019-08-27 16:02:47 -0500
commit84db7f8f65cd0ec77f09cfde365599df9890ce6c (patch)
treeeadedec4cb5f0db131442a6e594a5b8c61ee50cf /ice_validator/tests/test_environment_file_parameters.py
parentb1df832ae5ddaac6344b7ccf3f1f32a0bcfbdd67 (diff)
[VVP] Generated completed preload from env files
User can supply an optional directory containing .env files and/or CSAR VSP which can be used to generate populated preloads in the requested format. The nested directories can be used to create sub-environments that inherit their settings from the parent directories. Optionally, values can be specified in a defaults.yaml and they will be used if that value is not defined in the .env file. This is useful if the parameter name and value will be the same in all modules. Issue-ID: VVP-278 Change-Id: Icd9846c63463537793db908be8ce5dba13c4bda3 Signed-off-by: Lovett, Trevor <trevor.lovett@att.com>
Diffstat (limited to 'ice_validator/tests/test_environment_file_parameters.py')
-rw-r--r--ice_validator/tests/test_environment_file_parameters.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/ice_validator/tests/test_environment_file_parameters.py b/ice_validator/tests/test_environment_file_parameters.py
index ff57c35..69485bc 100644
--- a/ice_validator/tests/test_environment_file_parameters.py
+++ b/ice_validator/tests/test_environment_file_parameters.py
@@ -218,16 +218,22 @@ def run_test_parameter(yaml_file, resource_type, *prop, **kwargs):
assert not invalid_parameters, "\n".join(invalid_parameters)
-def get_preload_excluded_parameters(yaml_file):
+def get_preload_excluded_parameters(yaml_file, persistent_only=False, env_spec=None):
"""
Returns set of all parameters that should not be included in the preload's
vnf parameters/tag-values section.
+
+ if persistent_only only parameters that are marked as persistent will
+ be excluded
"""
+ env_spec = env_spec or ENV_PARAMETER_SPEC
results = []
- for resource_type, specs in ENV_PARAMETER_SPEC.items():
+ for resource_type, specs in env_spec.items():
# apply to all resources if not in the format of an OpenStack resource
all_resources = "::" not in resource_type
for spec in specs:
+ if persistent_only and not spec.get("persistent"):
+ continue
results.extend(get_template_parameters(yaml_file, resource_type,
spec, all_resources))
return {item["param"] for item in results}