mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 03:00:23 -07:00
Bug fixes for ontap_ucadapter.py (#44221)
This commit is contained in:
parent
374a22f4c7
commit
bc4f7abe96
1 changed files with 31 additions and 1 deletions
|
@ -21,7 +21,7 @@ short_description: ONTAP UC adapter configuration
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.na_ontap
|
- netapp.na_ontap
|
||||||
version_added: '2.6'
|
version_added: '2.6'
|
||||||
author: chhaya gunawat (chhayag@netapp.com)
|
author: NetApp Ansible Team (ng-ansibleteam@netapp.com)
|
||||||
|
|
||||||
description:
|
description:
|
||||||
- modify the UC adapter mode and type taking pending type and mode into account.
|
- modify the UC adapter mode and type taking pending type and mode into account.
|
||||||
|
@ -157,6 +157,34 @@ class NetAppOntapadapter(object):
|
||||||
self.module.fail_json(msg='Error modifying adapter %s: %s' % (self.adapter_name, to_native(e)),
|
self.module.fail_json(msg='Error modifying adapter %s: %s' % (self.adapter_name, to_native(e)),
|
||||||
exception=traceback.format_exc())
|
exception=traceback.format_exc())
|
||||||
|
|
||||||
|
def offline_adapter(self):
|
||||||
|
"""
|
||||||
|
Bring a Fibre Channel target adapter offline.
|
||||||
|
"""
|
||||||
|
adapter_offline = netapp_utils.zapi.NaElement('fcp-adapter-config-down')
|
||||||
|
adapter_offline.add_new_child('fcp-adapter', self.adapter_name)
|
||||||
|
adapter_offline.add_new_child('node', self.node_name)
|
||||||
|
try:
|
||||||
|
self.server.invoke_successfully(adapter_offline,
|
||||||
|
enable_tunneling=True)
|
||||||
|
except netapp_utils.zapi.NaApiError as e:
|
||||||
|
self.module.fail_json(msg='Error trying to offline fc-adapter %s: %s' % (self.adapter_name, to_native(e)),
|
||||||
|
exception=traceback.format_exc())
|
||||||
|
|
||||||
|
def online_adapter(self):
|
||||||
|
"""
|
||||||
|
Bring a Fibre Channel target adapter online.
|
||||||
|
"""
|
||||||
|
adapter_online = netapp_utils.zapi.NaElement('fcp-adapter-config-up')
|
||||||
|
adapter_online.add_new_child('fcp-adapter', self.adapter_name)
|
||||||
|
adapter_online.add_new_child('node', self.node_name)
|
||||||
|
try:
|
||||||
|
self.server.invoke_successfully(adapter_online,
|
||||||
|
enable_tunneling=True)
|
||||||
|
except netapp_utils.zapi.NaApiError as e:
|
||||||
|
self.module.fail_json(msg='Error trying to online fc-adapter %s: %s' % (self.adapter_name, to_native(e)),
|
||||||
|
exception=traceback.format_exc())
|
||||||
|
|
||||||
def apply(self):
|
def apply(self):
|
||||||
''' calling all adapter features '''
|
''' calling all adapter features '''
|
||||||
changed = False
|
changed = False
|
||||||
|
@ -182,7 +210,9 @@ class NetAppOntapadapter(object):
|
||||||
if self.module.check_mode:
|
if self.module.check_mode:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
self.offline_adapter()
|
||||||
self.modify_adapter()
|
self.modify_adapter()
|
||||||
|
self.online_adapter()
|
||||||
|
|
||||||
self.module.exit_json(changed=changed)
|
self.module.exit_json(changed=changed)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue