aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstark, steven <steven.stark@att.com>2019-10-04 13:09:28 -0700
committerstark, steven <steven.stark@att.com>2019-10-04 13:10:53 -0700
commitc238e85627eb8f34e030e043df8d2dc7e85e68f7 (patch)
treeb4aaf070ab43b5050bb693c8408ff024cdb5f104
parentd856b38ab47ce2405d343fcb7848629892d3c0b7 (diff)
[VVP] Bug fix if resource value is hardcoded
If the property value isn't a dictionary than the test run crashes Issue-ID: VVP-313 Signed-off-by: stark, steven <steven.stark@att.com> Change-Id: I926bc233909db245d5a051035f26fefaa39b5ede
-rw-r--r--ice_validator/tests/utils/vm_types.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/ice_validator/tests/utils/vm_types.py b/ice_validator/tests/utils/vm_types.py
index 56d824b..e0ea7e7 100644
--- a/ice_validator/tests/utils/vm_types.py
+++ b/ice_validator/tests/utils/vm_types.py
@@ -63,7 +63,9 @@ def get_vm_types_for_resource(resource):
vm_types = []
for k2, v2 in resource["properties"].items():
- if any([k2 not in key_values, "get_param" not in v2]):
+ if not isinstance(v2, dict) or any(
+ [k2 not in key_values, "get_param" not in v2]
+ ):
continue
formats = [v for v in key_value_formats if v[0] == k2]
for v3 in formats:
@@ -79,7 +81,12 @@ def get_vm_types_for_resource(resource):
def is_nova_server(resource):
- return isinstance(resource, dict) and "type" in resource and "properties" in resource and resource.get("type") == "OS::Nova::Server"
+ return (
+ isinstance(resource, dict)
+ and "type" in resource
+ and "properties" in resource
+ and resource.get("type") == "OS::Nova::Server"
+ )
def get_vm_type_for_nova_server(resource):