diff options
Diffstat (limited to 'ice_validator/tests')
-rw-r--r-- | ice_validator/tests/utils/vm_types.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ice_validator/tests/utils/vm_types.py b/ice_validator/tests/utils/vm_types.py index c531b67..ae14336 100644 --- a/ice_validator/tests/utils/vm_types.py +++ b/ice_validator/tests/utils/vm_types.py @@ -52,11 +52,7 @@ def get_vm_types_for_resource(resource): """ if not isinstance(resource, dict): return set() - if "type" not in resource: - return set() - if resource["type"] != "OS::Nova::Server": - return set() - if "properties" not in resource: + if not is_nova_server(resource): return set() key_values = ["name", "flavor", "image"] @@ -85,6 +81,11 @@ def get_vm_types_for_resource(resource): return set(vm_types) +def is_nova_server(resource): + + return "type" in resource and "properties" in resource and resource.get("type") == "OS::Nova::Server" + + def get_vm_type_for_nova_server(resource): """ Get the vm_type for a resource |