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>
This commit is contained in:
krisvasudevan 2019-05-13 00:23:25 -07:00 committed by Sumit Jaiswal
parent d0f2da4f76
commit d998791b4a
2 changed files with 5 additions and 5 deletions

View file

@ -159,7 +159,7 @@ def member_normalize(member_spec):
'ha_port_setting', 'lan_port_setting', 'lan2_physical_setting',
'lan_ha_port_setting', 'mgmt_network_setting', 'v6_mgmt_network_setting']
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]
if isinstance(member_spec[key], dict):
member_spec[key] = member_normalize(member_spec[key])

View file

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