Bug fixes for the nios member object (#56045)

* Bug fixes in api.py

* Examples updated in nios_member.py

* Update lib/ansible/module_utils/net_tools/nios/api.py

Co-Authored-By: Sumit Jaiswal <sjaiswal@redhat.com>
pull/56380/head
krisvasudevan 6 years ago committed by Sumit Jaiswal
parent d0f2da4f76
commit d998791b4a

@ -159,7 +159,7 @@ def member_normalize(member_spec):
'ha_port_setting', 'lan_port_setting', 'lan2_physical_setting', 'ha_port_setting', 'lan_port_setting', 'lan2_physical_setting',
'lan_ha_port_setting', 'mgmt_network_setting', 'v6_mgmt_network_setting'] 'lan_ha_port_setting', 'mgmt_network_setting', 'v6_mgmt_network_setting']
for key in member_spec.keys(): for key in member_spec.keys():
if key in member_elements: if key in member_elements and member_spec[key] is not None:
member_spec[key] = member_spec[key][0] member_spec[key] = member_spec[key][0]
if isinstance(member_spec[key], dict): if isinstance(member_spec[key], dict):
member_spec[key] = member_normalize(member_spec[key]) member_spec[key] = member_normalize(member_spec[key])

@ -330,11 +330,11 @@ EXAMPLES = '''
router_id: 150 router_id: 150
node_info: node_info:
- lan_ha_port_setting: - lan_ha_port_setting:
ha_ip_address: 192.168.1.70 - ha_ip_address: 192.168.1.70
mgmt_lan: 192.168.1.80 mgmt_lan: 192.168.1.80
- lan_ha_port_setting: - lan_ha_port_setting:
ha_ip_address: 192.168.1.71 - ha_ip_address: 192.168.1.71
mgmt_lan: 192.168.1.81 mgmt_lan: 192.168.1.81
comment: "Created by Ansible" comment: "Created by Ansible"
state: present state: present
provider: provider:

Loading…
Cancel
Save