From efd6c2af2ee7212c06a20e8767b39c79fc5490d9 Mon Sep 17 00:00:00 2001 From: mikewiebe Date: Wed, 20 Nov 2024 21:16:19 +0000 Subject: [PATCH 1/3] Remove unmanagable check --- plugins/modules/dcnm_vpc_pair.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugins/modules/dcnm_vpc_pair.py b/plugins/modules/dcnm_vpc_pair.py index 0130db341..5e8f17529 100644 --- a/plugins/modules/dcnm_vpc_pair.py +++ b/plugins/modules/dcnm_vpc_pair.py @@ -1104,9 +1104,6 @@ def dcnm_vpc_pair_translate_playbook_info(self, config, ip_sn, hn_sn): # Add other translations as required dcnm_vpc_pair_utils_translate_config(self, cfg) - # Check if the switches included in the config are Manageable. - dcnm_vpc_pair_utils_validate_devices(self, cfg) - def dcnm_vpc_pair_fetch_template_details(self, template_info): """ From 2f4972a74ddcebc52f0f3e2fab659a67d8054a0f Mon Sep 17 00:00:00 2001 From: mikewiebe Date: Wed, 20 Nov 2024 21:46:24 +0000 Subject: [PATCH 2/3] Remove unused import --- plugins/modules/dcnm_vpc_pair.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/modules/dcnm_vpc_pair.py b/plugins/modules/dcnm_vpc_pair.py index 5e8f17529..d6fbfb46d 100644 --- a/plugins/modules/dcnm_vpc_pair.py +++ b/plugins/modules/dcnm_vpc_pair.py @@ -436,7 +436,6 @@ dcnm_vpc_pair_utils_get_sync_status, dcnm_vpc_pair_utils_get_delete_list, dcnm_vpc_pair_utils_get_all_filtered_vpc_pair_pairs, - dcnm_vpc_pair_utils_validate_devices, ) From f2635feed39d869a6aae0a2774a1928a20ad35df Mon Sep 17 00:00:00 2001 From: mikewiebe Date: Wed, 20 Nov 2024 23:18:28 +0000 Subject: [PATCH 3/3] Remove unused functions --- .../network/dcnm/dcnm_vpc_pair_utils.py | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/plugins/module_utils/network/dcnm/dcnm_vpc_pair_utils.py b/plugins/module_utils/network/dcnm/dcnm_vpc_pair_utils.py index 06d509054..d99aac632 100644 --- a/plugins/module_utils/network/dcnm/dcnm_vpc_pair_utils.py +++ b/plugins/module_utils/network/dcnm/dcnm_vpc_pair_utils.py @@ -65,41 +65,6 @@ def dcnm_vpc_pair_utils_validate_profile(self, profile, arg_spec): return vpc_pair_profile_info -def dcnm_vpc_pair_utils_check_if_meta(self, dev): - - for elem in self.meta_switches: - if dev in elem: - return True - return False - - -def dcnm_vpc_pair_utils_validate_devices(self, cfg): - - if (cfg.get("peerOneId", None) is not None) and ( - cfg["peerOneId"] not in self.managable - ): - mesg = "Switch {0} is not Manageable".format(cfg["peerOneId"]) - self.module.fail_json(msg=mesg) - - if (cfg.get("peerTwoId", None) is not None) and ( - cfg["peerTwoId"] not in self.managable - ): - mesg = "Switch {0} is not Manageable".format(cfg["peerTwoId"]) - self.module.fail_json(msg=mesg) - - if (cfg.get("peerOneId", None) is not None) and ( - dcnm_vpc_pair_utils_check_if_meta(self, cfg["peerOneId"]) is True - ): - mesg = "Switch {0} is not Manageable".format(cfg["peerOneId"]) - self.module.fail_json(msg=mesg) - - if (cfg.get("peerTwoId", None) is not None) and ( - dcnm_vpc_pair_utils_check_if_meta(self, cfg["peerTwoId"]) is True - ): - mesg = "Switch {0} is not Manageable".format(cfg["peerTwoId"]) - self.module.fail_json(msg=mesg) - - def dcnm_vpc_pair_utils_translate_config(self, cfg): if cfg.get("peerOneId", "") != "":