From 5f0a88649a52a959251c400e6313cbab6d75ef75 Mon Sep 17 00:00:00 2001 From: Ezhilarasi Date: Thu, 26 Sep 2019 16:54:01 +0530 Subject: [PATCH] Sonarfix: Reduce cognitive complexity Change-Id: I18a9802c643f778c2aedb658848c091ff8a1587c Issue-ID: VVP-296 Signed-off-by: Ezhilarasi --- ice_validator/tests/utils/vm_types.py | 8 +------- 1 file changed, 1 insertion(+), 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): -- 2.16.6