Skip to content

Commit

Permalink
[ignore_changes] Fixing documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
anvitha-jain committed Nov 14, 2024
1 parent e253d7b commit 3e83428
Show file tree
Hide file tree
Showing 4 changed files with 287 additions and 240 deletions.
13 changes: 13 additions & 0 deletions plugins/module_utils/mso.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,19 @@ def write_file(module, url, dest, content, resp, tmpsrc=None):
os.remove(tmpsrc)


def format_interface_descriptions(interface_descriptions, node=None):
formated_interface_descriptions = [
{
"nodeID": node if node is not None else interface_description.get("node"),
"interfaceID": interface_description.get("interface_id", interface_description.get("interfaceID")),
"description": interface_description.get("description"),
}
for interface_description in interface_descriptions
]

return formated_interface_descriptions


class MSOModule(object):
def __init__(self, module):
self.module = module
Expand Down
4 changes: 2 additions & 2 deletions plugins/module_utils/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def get_interface_policy_group_uuid(self, interface_policy_group):
:param interface_policy_group: Name of the Interface Policy Group to search for -> Str
:return: UUID of the Interface Policy Group. -> Str
"""
existing_policies = self.template.get("fabricPolicyTemplate", {}).get("template", {}).get("interfacePolicyGroups", [])
existing_policy_groups = self.template.get("fabricPolicyTemplate", {}).get("template", {}).get("interfacePolicyGroups", [])
kv_list = [KVPair("name", interface_policy_group)]
match = self.get_object_by_key_value_pairs("Interface Policy Groups", existing_policies, kv_list, fail_module=True)
match = self.get_object_by_key_value_pairs("Interface Policy Groups", existing_policy_groups, kv_list, fail_module=True)
return match.details.get("uuid")
Loading

0 comments on commit 3e83428

Please sign in to comment.