Code Review
/
vvp
/
validation-scripts.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Sonarfix: Reduce cognitive complexity
[vvp/validation-scripts.git]
/
ice_validator
/
tests
/
utils
/
vm_types.py
diff --git
a/ice_validator/tests/utils/vm_types.py
b/ice_validator/tests/utils/vm_types.py
index
ae6d7ff
..
7570581
100644
(file)
--- a/
ice_validator/tests/utils/vm_types.py
+++ b/
ice_validator/tests/utils/vm_types.py
@@
-50,8
+50,6
@@
def get_vm_types_for_resource(resource):
- If more than one vm_type is detected all vm_types will
be returned
"""
- If more than one vm_type is detected all vm_types will
be returned
"""
- if not isinstance(resource, dict):
- return set()
if not is_nova_server(resource):
return set()
if not is_nova_server(resource):
return set()
@@
-83,11
+81,7
@@
def get_vm_types_for_resource(resource):
def is_nova_server(resource):
def is_nova_server(resource):
- return (
- "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):
def get_vm_type_for_nova_server(resource):