diff options
-rw-r--r-- | ice_validator/tests/structures.py | 18 | ||||
-rw-r--r-- | ice_validator/tests/test_network_format.py | 8 |
2 files changed, 15 insertions, 11 deletions
diff --git a/ice_validator/tests/structures.py b/ice_validator/tests/structures.py index 0223bc3..a435246 100644 --- a/ice_validator/tests/structures.py +++ b/ice_validator/tests/structures.py @@ -252,15 +252,19 @@ class ContrailV2NetworkFlavorBaseProcessor(HeatProcessor): network_flavor = cls.network_flavor_internal else: p = param.get("get_param") - if isinstance(p, str): - if "_int_" in p or p.startswith("int_"): - network_flavor = cls.network_flavor_internal - elif "_subint_" in p: - network_flavor = cls.network_flavor_subint - else: - network_flavor = cls.network_flavor_external + network_flavor = cls.get_network_format(p) return network_flavor + @classmethod + def get_network_format(cls, param): + if isinstance(param, str): + if "_int_" in param or param.startswith("int_"): + return cls.network_flavor_internal + elif "_subint_" in param: + return cls.network_flavor_subint + else: + return cls.network_flavor_external + class ContrailV2InstanceIpProcessor(ContrailV2NetworkFlavorBaseProcessor): """ ContrailV2 InstanceIp diff --git a/ice_validator/tests/test_network_format.py b/ice_validator/tests/test_network_format.py index e360795..de8115d 100644 --- a/ice_validator/tests/test_network_format.py +++ b/ice_validator/tests/test_network_format.py @@ -112,11 +112,11 @@ def test_network_has_subnet(yaml_file): networks.append(k) for k, v in yml["resources"].items(): - if not has_properties(v) and v.get("type") != "OS::Neutron::Subnet": - continue network_prop = v.get("properties", {}).get("network", {}).get("get_resource") - - if not network_prop: + if ( + not has_properties(v) and v.get("type") != "OS::Neutron::Subnet" + and not network_prop + ): continue x = 0 for network in networks: |