- results.extend(get_template_parameters(yaml_file, resource_type,
- spec, all_resources))
- return {item["param"] for item in results}
-
-
-def get_template_parameters(yaml_file, resource_type, spec, all_resources=False):
+ if persistent_only and not spec.get("persistent"):
+ continue
+ results.extend(
+ get_template_parameters(
+ yaml_file, resource_type, spec, all_resources, nested_resources=True
+ )
+ )
+ results = {item["param"] for item in results}
+ for param in Heat(yaml_file).parameters:
+ # AZs often are manipulated and passed into nested templates making
+ # them difficult to detect by looking for the assignment. We'll
+ # just extract them from the parameters if they are there to be safe
+ if re.match(r"availability_zone_\d+", param):
+ results.add(param)
+ return results
+
+
+def get_template_parameters(
+ yaml_file, resource_type, spec, all_resources=False, nested_resources=False
+):