Skip to content

Module: dcnm_vpc_pair - Remove Manageable Check for Devices #345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading