From 679c56177a3c845e6e59b762d49e11fd931ebc62 Mon Sep 17 00:00:00 2001 From: alaa-bish Date: Thu, 17 Feb 2022 11:39:32 +0200 Subject: [PATCH] Fix sanity:Gihub#101 --- plugins/module_utils/prism/groups.py | 4 ++-- plugins/module_utils/prism/virtual_switches.py | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/module_utils/prism/groups.py b/plugins/module_utils/prism/groups.py index 5b876db59..86af84ed7 100644 --- a/plugins/module_utils/prism/groups.py +++ b/plugins/module_utils/prism/groups.py @@ -12,8 +12,8 @@ def __init__(self, module): resource_type = "/groups" super(Groups, self).__init__(module, resource_type=resource_type) - def get_uuid(self, entity_type, filter): - data = {"entity_type": entity_type, "filter_criteria": filter} + def get_uuid(self, value, key): + data = {"entity_type": value, "filter_criteria": key} resp, status = self.list(data, use_base_url=True) if resp.get("group_results"): return resp["group_results"][0]["entity_results"][0]["entity_id"] diff --git a/plugins/module_utils/prism/virtual_switches.py b/plugins/module_utils/prism/virtual_switches.py index 19b61fb3d..5c8bac218 100644 --- a/plugins/module_utils/prism/virtual_switches.py +++ b/plugins/module_utils/prism/virtual_switches.py @@ -13,9 +13,7 @@ def get_dvs_uuid(config, module): if "name" in config: groups = Groups(module) name = config["name"] - uuid = groups.get_uuid( - entity_type="distributed_virtual_switch", filter="name=={0}".format(name) - ) + uuid = groups.get_uuid("distributed_virtual_switch", "name=={0}".format(name)) if not uuid: error = "Virtual Switch {0} not found.".format(name) return None, error