aboutsummaryrefslogtreecommitdiffstats
path: root/ice_validator
diff options
context:
space:
mode:
authorstark, steven <steven.stark@att.com>2019-02-01 13:02:56 -0800
committerstark, steven <steven.stark@att.com>2019-02-01 13:15:47 -0800
commit912ea4cdf9721f66339c47bbfdcf4315ca7bd424 (patch)
treef0e5e4e66c103e866e4fed8e660a1063e268b329 /ice_validator
parentab01f96b1405bc037853847138a121581bb98f05 (diff)
[VVP] pseudo-parameters nested parameters
Change-Id: Iff7630a6f62fa8b83c80048d6efc12d187037412 Issue-ID: VVP-157 Signed-off-by: stark, steven <steven.stark@att.com>
Diffstat (limited to 'ice_validator')
-rw-r--r--ice_validator/tests/test_nested_parameters.py5
-rw-r--r--ice_validator/tests/utils/nested_iterables.py8
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):