X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ice_validator%2Ftests%2Ftest_environment_file_parameters.py;h=84c5c34491052738e4907a1835e772341feb8e40;hb=ded5c74ea07eb1541587de1042444fa6b590ddde;hp=99d76a0be8dfa9f204d8e16a563435854938cddb;hpb=1d319a416ba8f0cb764d86323f78318b0d3a8f4c;p=vvp%2Fvalidation-scripts.git diff --git a/ice_validator/tests/test_environment_file_parameters.py b/ice_validator/tests/test_environment_file_parameters.py index 99d76a0..84c5c34 100644 --- a/ice_validator/tests/test_environment_file_parameters.py +++ b/ice_validator/tests/test_environment_file_parameters.py @@ -59,13 +59,13 @@ from tests.utils.nested_files import file_is_a_nested_template # at the end of a property to make it a tuple. ENV_PARAMETER_SPEC = { "PLATFORM PROVIDED": [ - {"property": ("metadata", "vnf_id",), "persistent": False, "kwargs": {}}, - {"property": ("metadata", "vnf_name",), "persistent": False, "kwargs": {}}, - {"property": ("metadata", "vf_module_id",), "persistent": False, "kwargs": {}}, - {"property": ("metadata", "vf_module_index",), "persistent": False, "kwargs": {}}, - {"property": ("metadata", "vf_module_name",), "persistent": False, "kwargs": {}}, - {"property": ("metadata", "workload_context",), "persistent": False, "kwargs": {}}, - {"property": ("metadata", "environment_context",), "persistent": False, "kwargs": {}}, + {"property": ("vnf_id",), "persistent": False, "kwargs": {}}, + {"property": ("vnf_name",), "persistent": False, "kwargs": {}}, + {"property": ("vf_module_id",), "persistent": False, "kwargs": {}}, + {"property": ("vf_module_index",), "persistent": False, "kwargs": {}}, + {"property": ("vf_module_name",), "persistent": False, "kwargs": {}}, + {"property": ("workload_context",), "persistent": False, "kwargs": {}}, + {"property": ("environment_context",), "persistent": False, "kwargs": {}}, {"property": (r"^(.+?)_net_fqdn$",), "persistent": False, "kwargs": {}}, ], "ALL": [{"property": ("name",), "persistent": False, "kwargs": {}}], @@ -234,8 +234,11 @@ def get_preload_excluded_parameters(yaml_file, persistent_only=False, env_spec=N 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, nested_resources=True)) + results.extend( + get_template_parameters( + yaml_file, resource_type, spec, all_resources, nested_resources=True + ) + ) results = {item["param"] for item in results} for param in Heat(yaml_file).parameters: # AZs often are manipulated and passed into nested templates making @@ -246,14 +249,18 @@ def get_preload_excluded_parameters(yaml_file, persistent_only=False, env_spec=N return results -def get_template_parameters(yaml_file, resource_type, spec, all_resources=False, nested_resources=False): +def get_template_parameters( + yaml_file, resource_type, spec, all_resources=False, nested_resources=False +): parameters = [] heat = Heat(yaml_file) if all_resources: resources = heat.resources if not nested_resources else heat.get_all_resources() else: - resources = heat.get_resource_by_type(resource_type, all_resources=nested_resources) + resources = heat.get_resource_by_type( + resource_type, all_resources=nested_resources + ) for rid, resource_props in resources.items(): for param in prop_iterator(resource_props, *spec.get("property")): if param and get_param(param) and param_helper(spec, get_param(param), rid):