-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add a new module to manage Virtual Port Channel Interfaces in Fabric Resource Policies Template. (DCNE-53) #551
base: master
Are you sure you want to change the base?
Conversation
4f77f85
to
d5cfb35
Compare
d5cfb35
to
bca2eee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ad06fce
to
e953212
Compare
e953212
to
0e6144b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
tests/integration/targets/ndo_virtual_port_channel_interface/tasks/main.yml
Show resolved
Hide resolved
8dbc55e
to
af7cd75
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious as to what would happen in this scenario where node_1 is not mentioned in the second config and interfaces_1 is changed to 1/2? Likely node_1 would be sent in the payload as null and NDO would complain in the response? If yes, then we need to modify the append_update_ops_data() a little...
- name: Create a new virtual port channel interface
cisco.mso.ndo_virtual_port_channel_interface:
<<: *mso_info
template: ansible_fabric_resource_template
virtual_port_channel_interface: ansible_virtual_port_channel_interface
description: Ansible Virtual Port Channel test
node_1: 101
node_2: 102
interfaces_1: 1/1
interfaces_2: 1/1
interface_policy_group:
name: ansible_test_interface_policy_group_port_channel
template: ansible_fabric_policy_template
interface_descriptions:
- node: 101
interface_id: 1/1
description: first Ansible interface test for first node
- node: 102
interface_id: 1/1
description: first Ansible interface test for second node
state: present
- name: Create a new virtual port channel interface with change in interfaces
cisco.mso.ndo_virtual_port_channel_interface:
<<: *mso_info
template: ansible_fabric_resource_template
virtual_port_channel_interface: ansible_virtual_port_channel_interface
description: Ansible Virtual Port Channel test
node_2: 102
interfaces_1: 1/2
interfaces_2: 1/1
interface_policy_group:
name: ansible_test_interface_policy_group_port_channel
template: ansible_fabric_policy_template
interface_descriptions:
- node: 101
interface_id: 1/1
description: first Ansible interface test for first node
- node: 102
interface_id: 1/1
description: first Ansible interface test for second node
state: present
…r possible empty strings attributes.
…riptions for payload data.
…t_channel_interfaces.
…rtual_port_channel_interface.py module to be consistent with future modules.
…t_channel_interface module. enhance format_interface_descriptions function to format range of interface IDs.
…ort_channel_interface module. Modify Documentation and Example sections.
…rface module when handling null value.
af7cd75
to
5ccdfdf
Compare
…s being updated or created for ndo_virtual_port_channel_interface module.
5ccdfdf
to
94aba9f
Compare
interface_policy_group_uuid = fabric_policy_template.get_interface_policy_group_uuid(interface_policy_group.get("name")) | ||
|
||
if mso.existing: | ||
mso_values = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use dict()
instead of {}
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we in the case we have tuples as keys? I think it is better in all aspect to use {}
format instead of using the dict()
class for this case specifically because we would have to do something like this with the dict class:
my_dict_test = dict([((1, 2), "value1"), ((3, 4), "value2")])
which is definitely less readable and less optimal than {}
format.
tests/integration/targets/ndo_virtual_port_channel_interface/tasks/main.yml
Show resolved
Hide resolved
tests/integration/targets/ndo_virtual_port_channel_interface/tasks/main.yml
Show resolved
Hide resolved
…ction to be a minimum requirements creation task in test file for ndo_virtual_port_channel_interface.
resolves #467
New Modules Added: