+ """
+ acceptable_resources = []
+ dirname = os.path.dirname(volume_template)
+ list_of_files = get_list_of_nested_files(volume_template, dirname)
+
+ list_of_files.append(volume_template)
+
+ for file in list_of_files:
+ with open(file) as fh:
+ yml = yaml.load(fh)
+ resources = yml.get("resources") or {}
+ for k, v in resources.items():
+ if not isinstance(v, dict):
+ continue
+ if "type" not in v:
+ continue
+ if v["type"] in ["OS::Cinder::Volume", "OS::Heat::ResourceGroup"]:
+ acceptable_resources.append(k)
+
+ assert acceptable_resources, (
+ "No OS::Cinder::Volume or OS::Heat::ResourceGroup resources "
+ "found in volume module"
+ )
+
+
+@validates("R-55306")
+def test_no_vf_module_index_in_cinder(volume_template):
+ """
+ vf_module_index is prohibited in volume templates
+ """
+