Skip to content

Commit

Permalink
[ignore] Modify payload for Node1Details and Node2Details if object i…
Browse files Browse the repository at this point in the history
…s being updated or created for ndo_virtual_port_channel_interface module.
  • Loading branch information
gmicol committed Dec 19, 2024
1 parent bf9e238 commit 94aba9f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
39 changes: 24 additions & 15 deletions plugins/modules/ndo_virtual_port_channel_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,26 +385,35 @@ def main():
fabric_policy_template.validate_template("fabricPolicy")
interface_policy_group_uuid = fabric_policy_template.get_interface_policy_group_uuid(interface_policy_group.get("name"))

mso_values = dict(
name=name,
description=description,
node1Details=dict(
node=node_1,
memberInterfaces=interfaces_node_1,
),
node2Details=dict(
node=node_2,
memberInterfaces=interfaces_node_2,
),
policy=interface_policy_group_uuid,
interfaceDescriptions=format_interface_descriptions(mso, interface_descriptions),
)

if mso.existing:
mso_values = {
"name": name,
"description": description,
("node1Details", "node"): node_1,
("node1Details", "memberInterfaces"): interfaces_node_1,
("node2Details", "node"): node_2,
("node2Details", "memberInterfaces"): interfaces_node_2,
"policy": interface_policy_group_uuid,
"interfaceDescriptions": format_interface_descriptions(mso, interface_descriptions),
}
append_update_ops_data(ops, match.details, virtual_port_channel_attrs_path, mso_values)
mso.sanitize(match.details, collate=True)

else:
mso_values = dict(
name=name,
description=description,
node1Details=dict(
node=node_1,
memberInterfaces=interfaces_node_1,
),
node2Details=dict(
node=node_2,
memberInterfaces=interfaces_node_2,
),
policy=interface_policy_group_uuid,
interfaceDescriptions=format_interface_descriptions(mso, interface_descriptions),
)
mso.sanitize(mso_values)
ops.append(dict(op="add", path="/fabricResourceTemplate/template/virtualPortChannels/-", value=mso.sent))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@
register: query_one

- name: Query a virtual port channel with template_name and UUID
cisco.mso.ndo_tenant_custom_qos_policy: &query_virtual_port_channel_uuid
cisco.mso.ndo_virtual_port_channel_interface: &query_virtual_port_channel_uuid
<<: *create_virtual_port_channel_interface_2
uuid: '{{ query_one.current.uuid }}'
name: '{{ fakevar | default(omit)}}'
Expand Down

0 comments on commit 94aba9f

Please sign in to comment.