diff options
Diffstat (limited to 'ice_validator')
-rw-r--r-- | ice_validator/tests/test_nested_parameters.py | 5 | ||||
-rw-r--r-- | ice_validator/tests/utils/nested_iterables.py | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/ice_validator/tests/test_nested_parameters.py b/ice_validator/tests/test_nested_parameters.py index 251e7c1..12b5768 100644 --- a/ice_validator/tests/test_nested_parameters.py +++ b/ice_validator/tests/test_nested_parameters.py @@ -43,6 +43,7 @@ import pytest from tests import cached_yaml as yaml from tests.structures import Resource from .helpers import validates +from .utils.nested_iterables import is_pseudo_param VERSION = "1.0.0" @@ -57,7 +58,6 @@ def check_nested_parameter_doesnt_change(yaml_file): pytest.skip("No resources specified in the heat template") invalid_parameters = [] - """ checking if property: { get_param: parameter }, then property == parameter @@ -95,6 +95,9 @@ def check_nested_parameter_doesnt_change(yaml_file): if isinstance(parameter, list): parameter = parameter[0] + if is_pseudo_param(parameter): + continue + if k1 != parameter: invalid_parameters.append( { diff --git a/ice_validator/tests/utils/nested_iterables.py b/ice_validator/tests/utils/nested_iterables.py index 5966201..44ca2bc 100644 --- a/ice_validator/tests/utils/nested_iterables.py +++ b/ice_validator/tests/utils/nested_iterables.py @@ -38,6 +38,11 @@ # +def is_pseudo_param(parameter): + pseudo_parameters = ["OS::stack_name", "OS::stack_id", "OS::project_id"] + return parameter in pseudo_parameters + + def parse_nested_dict(d, key=""): """ parse the nested dictionary and return values of @@ -63,13 +68,12 @@ def find_all_get_param_in_yml(yml): Recursively find all referenced parameters in a parsed yaml body and return a list of parameters """ - os_pseudo_parameters = ["OS::stack_name", "OS::stack_id", "OS::project_id"] if not hasattr(yml, "items"): return [] params = [] for k, v in yml.items(): - if k == "get_param" and v not in os_pseudo_parameters: + if k == "get_param" and not is_pseudo_param(v): if isinstance(v, list) and not isinstance(v[0], dict): params.append(v[0]) elif not isinstance(v, dict) and isinstance(v, str): |