[VVP] Allow lists in test_availability_zone
[vvp/validation-scripts.git] / ice_validator / tests / test_availability_zone.py
index ba71d14..7feefc9 100644 (file)
@@ -50,12 +50,12 @@ VERSION = "1.1.0"
 
 
 @validates("R-98450")
-def test_availability_zone_naming(heat_template):
+def test_availability_zone_naming(yaml_file):
     """
     Make sure all availability zones are properly formatted
     """
 
-    with open(heat_template) as fh:
+    with open(yaml_file) as fh:
         yml = yaml.load(fh)
 
     # skip if resources are not defined
@@ -80,7 +80,10 @@ def test_availability_zone_naming(heat_template):
                     continue
                 if "get_param" not in v2:
                     invalid_availability_zones.add(k1)
-                elif not re.match(r"availability_zone_\d+", v2["get_param"]):
+                    continue
+                if not isinstance(v2["get_param"], str):
+                    continue
+                if not re.match(r"availability_zone_\d+", v2["get_param"]):
                     invalid_availability_zones.add(v2["get_param"])
 
     assert not invalid_availability_zones, "invalid availability zones %s" % list(