diff options
author | Steven Wright <sw3588@att.com> | 2019-10-01 14:25:53 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-10-01 14:25:53 +0000 |
commit | f9b8aeaed0a323ba8666c0e0706eded720e0b5da (patch) | |
tree | e4bcf4bf6cfa0d2ecfaac62221588479524eed0d /ice_validator | |
parent | 0c8c078d41b364602ed967a1bdffdb06c6b53ea7 (diff) | |
parent | 5f0a88649a52a959251c400e6313cbab6d75ef75 (diff) |
Merge "Sonarfix: Reduce cognitive complexity"
Diffstat (limited to 'ice_validator')
-rw-r--r-- | ice_validator/tests/utils/vm_types.py | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/ice_validator/tests/utils/vm_types.py b/ice_validator/tests/utils/vm_types.py index ae6d7ff..7570581 100644 --- 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 not isinstance(resource, dict): - 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): - 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): |