diff options
author | steven stark <steven.stark@att.com> | 2019-11-12 21:49:01 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-11-12 21:49:01 +0000 |
commit | ce4c2c329b7b9afbb70f22644748688aa8e5fb0e (patch) | |
tree | 39214d5299907d014b97727845e0d3500249d11c /ice_validator | |
parent | 4a469129424e9727c0d814a05ab52373b237ff2e (diff) | |
parent | f8590584ebf86014951c8bf19b9d7c14f9a10e81 (diff) |
Merge "[VVP] Handle intrinsic functions in prop_iterator"
Diffstat (limited to 'ice_validator')
-rw-r--r-- | ice_validator/tests/helpers.py | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/ice_validator/tests/helpers.py b/ice_validator/tests/helpers.py index 424dde1..f4a368c 100644 --- a/ice_validator/tests/helpers.py +++ b/ice_validator/tests/helpers.py @@ -53,6 +53,23 @@ __path__ = [os.path.dirname(os.path.abspath(__file__))] DEFAULT_OUTPUT_DIR = "{}/../output".format(__path__[0]) RE_BASE = re.compile(r"(^base$)|(^base_)|(_base_)|(_base$)") +INTRINSIC_FUNCTIONS = [ + "get_resource", + "get_attr", + "str_replace", + "get_param", + "list_join", + "get_file", + "resource_facade", + "Fn::Select", + "repeat", + "digest", + "str_split", + "yaql", + "map_replace", + "map_merge", +] + def is_base_module(template_path): basename = os.path.basename(template_path).lower() @@ -321,12 +338,13 @@ def parameter_type_to_heat_type(parameter): def prop_iterator(resource, *props): - terminators = ["get_resource", "get_attr", "str_replace", "get_param"] if "properties" in resource: resource = resource.get("properties") props = list(props) - if isinstance(resource, dict) and any(x for x in terminators if x in resource): + if isinstance(resource, dict) and any( + x for x in INTRINSIC_FUNCTIONS if x in resource + ): yield resource else: prop = resource.get(props.pop(0)) @@ -426,5 +444,9 @@ def is_nova_server(resource): """ checks resource is a nova server """ - return isinstance(resource, dict) and "type" in resource and "properties" in resource and resource.get("type") == "OS::Nova::Server" - + return ( + isinstance(resource, dict) + and "type" in resource + and "properties" in resource + and resource.get("type") == "OS::Nova::Server" + ) |