Code Review
/
vvp
/
validation-scripts.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
[VVP] adding list support for non-server-name uniqueness
[vvp/validation-scripts.git]
/
ice_validator
/
tests
/
structures.py
diff --git
a/ice_validator/tests/structures.py
b/ice_validator/tests/structures.py
index
6461879
..
a6b2015
100644
(file)
--- a/
ice_validator/tests/structures.py
+++ b/
ice_validator/tests/structures.py
@@
-35,7
+35,6
@@
#
# ============LICENSE_END============================================
#
#
# ============LICENSE_END============================================
#
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
#
"""structures
"""
#
"""structures
"""
@@
-86,13
+85,19
@@
class HeatProcessor(object):
# regex parses the proper resource id format.
@staticmethod
# 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:
"""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
else:
v = None
return v
@@
-162,7
+167,7
@@
class HeatProcessor(object):
# are replaced in the template in arbitrary order.
name = template
for key, value in params.items():
# 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))
if param is None:
return None
name = name.replace(key, str(param))
@@
-453,7
+458,7
@@
class ContrailV2VirtualNetworkProcessor(HeatProcessor):
re_rids = collections.OrderedDict(
[
("network", _get_regex(r"int" r"_(?P<network_role>.+)" r"_network" r"$")),
re_rids = collections.OrderedDict(
[
("network", _get_regex(r"int" r"_(?P<network_role>.+)" r"_network" r"$")),
- ("rvn", _get_regex(r"int" r"_(?P<network_role>.+)" r"_RVN" r"$")),
+
#
("rvn", _get_regex(r"int" r"_(?P<network_role>.+)" r"_RVN" r"$")),
]
)
]
)