-
- with open(yaml_file) as fh:
- yml = yaml.load(fh)
-
- # skip if resources are not defined
- if "resources" not in yml:
- pytest.skip("No resources specified in the heat template")
-
- invalid_networks = []
- for k, v in yml["resources"].items():
- if not has_properties(v):
- continue
- if property_uses_get_resource(v, "network"):
- continue
- if v.get("type") not in NETWORK_RESOURCE_TYPES:
- continue
- match = RE_INTERNAL_NETWORK_RID.match(k)
- if not match:
- invalid_networks.append(k)
-
- assert not set(invalid_networks), (
+ invalid_networks = {
+ r_id for r_id in network_ids if not RE_INTERNAL_NETWORK_RID.match(r_id)
+ }
+ assert not invalid_networks, (