mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
bug fix to na_ontap_interface (#54469)
* bug fix * Update lib/ansible/modules/storage/netapp/na_ontap_interface.py Co-Authored-By: carchi8py <carchi@netapp.com>
This commit is contained in:
parent
023c5167fd
commit
5173548a9f
1 changed files with 19 additions and 18 deletions
|
@ -156,26 +156,27 @@ class NetAppOntapInterface(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
||||||
self.argument_spec = netapp_utils.na_ontap_host_argument_spec()
|
self.argument_spec = netapp_utils.na_ontap_host_argument_spec()
|
||||||
self.argument_spec.update(
|
self.argument_spec.update(dict(
|
||||||
state=dict(type='str', default='present', choices=['absent', 'present']),
|
state=dict(required=False, choices=[
|
||||||
interface_name=dict(type='str', required=True),
|
'present', 'absent'], default='present'),
|
||||||
home_node=dict(type='str'),
|
interface_name=dict(required=True, type='str'),
|
||||||
home_port=dict(type='str'),
|
home_node=dict(required=False, type='str', default=None),
|
||||||
role=dict(type='str'),
|
home_port=dict(required=False, type='str'),
|
||||||
address=dict(type='str'),
|
role=dict(required=False, type='str'),
|
||||||
netmask=dict(type='str'),
|
address=dict(required=False, type='str'),
|
||||||
vserver=dict(type='str', required=True),
|
netmask=dict(required=False, type='str'),
|
||||||
firewall_policy=dict(type='str'),
|
vserver=dict(required=True, type='str'),
|
||||||
failover_policy=dict(type='str'),
|
firewall_policy=dict(required=False, type='str', default=None),
|
||||||
admin_status=dict(type='str', choices=['up', 'down']),
|
failover_policy=dict(required=False, type='str', default=None),
|
||||||
subnet_name=dict(type='str'),
|
admin_status=dict(required=False, choices=['up', 'down']),
|
||||||
is_auto_revert=dict(type='bool'),
|
subnet_name=dict(required=False, type='str'),
|
||||||
protocols=dict(type='list'),
|
is_auto_revert=dict(required=False, type='bool', default=None),
|
||||||
)
|
protocols=dict(required=False, type='list')
|
||||||
|
))
|
||||||
|
|
||||||
self.module = AnsibleModule(
|
self.module = AnsibleModule(
|
||||||
argument_spec=self.argument_spec,
|
argument_spec=self.argument_spec,
|
||||||
supports_check_mode=True,
|
supports_check_mode=True
|
||||||
)
|
)
|
||||||
self.na_helper = NetAppModule()
|
self.na_helper = NetAppModule()
|
||||||
self.parameters = self.na_helper.set_parameters(self.module.params)
|
self.parameters = self.na_helper.set_parameters(self.module.params)
|
||||||
|
@ -250,7 +251,7 @@ class NetAppOntapInterface(object):
|
||||||
if self.parameters.get('protocols') is not None:
|
if self.parameters.get('protocols') is not None:
|
||||||
data_protocols_obj = netapp_utils.zapi.NaElement('data-protocols')
|
data_protocols_obj = netapp_utils.zapi.NaElement('data-protocols')
|
||||||
for protocol in self.parameters.get('protocols'):
|
for protocol in self.parameters.get('protocols'):
|
||||||
if protocol.lower() == 'fc-nvme':
|
if protocol.lower() in ['fc-nvme', 'fcp']:
|
||||||
required_keys.remove('address')
|
required_keys.remove('address')
|
||||||
required_keys.remove('home_port')
|
required_keys.remove('home_port')
|
||||||
required_keys.remove('netmask')
|
required_keys.remove('netmask')
|
||||||
|
|
Loading…
Reference in a new issue