Skip to content

Commit

Permalink
Merge pull request #345 from CiscoDevNet/remove_unmanagable_check
Browse files Browse the repository at this point in the history
Module: dcnm_vpc_pair - Remove Manageable Check for Devices
  • Loading branch information
mikewiebe authored Nov 20, 2024
2 parents 5186384 + f2635fe commit 308acb6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
35 changes: 0 additions & 35 deletions plugins/module_utils/network/dcnm/dcnm_vpc_pair_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", "") != "":
Expand Down
4 changes: 0 additions & 4 deletions plugins/modules/dcnm_vpc_pair.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)


Expand Down Expand Up @@ -1104,9 +1103,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):

"""
Expand Down

0 comments on commit 308acb6

Please sign in to comment.