X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ice_validator%2Ftests%2Ftest_volume_templates.py;h=634da5c58fa729e68e3a580aac98267857771b17;hb=0c4e64d87728b89aa9cd4d41d738f5bfe64ceee3;hp=bb358d5ec9dbc54d4d5abbb19c10c9e5d7f59e6c;hpb=1f4df7c7ad27b23773ad9cdbe4db1632ce388cf1;p=vvp%2Fvalidation-scripts.git diff --git a/ice_validator/tests/test_volume_templates.py b/ice_validator/tests/test_volume_templates.py index bb358d5..634da5c 100644 --- a/ice_validator/tests/test_volume_templates.py +++ b/ice_validator/tests/test_volume_templates.py @@ -35,7 +35,6 @@ # # ============LICENSE_END============================================ # -# ECOMP is a trademark and service mark of AT&T Intellectual Property. # from tests import cached_yaml as yaml @@ -53,24 +52,16 @@ def test_volume_templates_contains_cinder_or_resource_group(volume_template): in fact volume templates """ acceptable_resources = [] - - with open(volume_template) 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") - dirname = os.path.dirname(volume_template) - list_of_files = get_list_of_nested_files(yml, dirname) + 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) - - for k, v in yml["resources"].items(): + resources = yml.get("resources") or {} + for k, v in resources.items(): if not isinstance(v, dict): continue if "type" not in v: