X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ice_validator%2Ftests%2Fstructures.py;h=a6b2015d50c921ac0f60f70770a6b42a9e4824aa;hb=b4faced895883a6a6f93bec02d7df4b165a6e75c;hp=9c47b8042687803f5b7458c649a642c35d2b32e7;hpb=8540eb59f7e7f8ff2043a8eaf7edfc255a60874a;p=vvp%2Fvalidation-scripts.git diff --git a/ice_validator/tests/structures.py b/ice_validator/tests/structures.py index 9c47b80..a6b2015 100644 --- a/ice_validator/tests/structures.py +++ b/ice_validator/tests/structures.py @@ -85,13 +85,19 @@ class HeatProcessor(object): # regex parses the proper resource id format. @staticmethod - def get_param_value(value): + def get_param_value(value, withIndex=False): """Return get_param value of `value` """ if isinstance(value, dict) and len(value) == 1: v = value.get("get_param") if isinstance(v, list) and v: - v = v[0] + if withIndex and len(v) > 1: + idx = v[1] + if isinstance(idx, dict): + idx = idx.get("get_param", idx) + v = "{}{}".format(v[0], idx) + else: + v = v[0] else: v = None return v @@ -161,7 +167,7 @@ class HeatProcessor(object): # are replaced in the template in arbitrary order. name = template for key, value in params.items(): - param = cls.get_param_value(value) + param = cls.get_param_value(value, withIndex=True) if param is None: return None name = name.replace(key, str(param)) @@ -452,7 +458,7 @@ class ContrailV2VirtualNetworkProcessor(HeatProcessor): re_rids = collections.OrderedDict( [ ("network", _get_regex(r"int" r"_(?P.+)" r"_network" r"$")), - ("rvn", _get_regex(r"int" r"_(?P.+)" r"_RVN" r"$")), + # ("rvn", _get_regex(r"int" r"_(?P.+)" r"_RVN" r"$")), ] )