mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Bug fixes for na_ontap_fcp (#48583)
This commit is contained in:
parent
0b380b09bf
commit
6dc6538eef
1 changed files with 11 additions and 3 deletions
|
@ -111,9 +111,12 @@ class NetAppOntapFCP(object):
|
|||
try:
|
||||
self.server.invoke_successfully(netapp_utils.zapi.NaElement('fcp-service-start'), True)
|
||||
except netapp_utils.zapi.NaApiError as error:
|
||||
self.module.fail_json(msg='Error starting FCP %s' %
|
||||
(to_native(error)),
|
||||
exception=traceback.format_exc())
|
||||
# Error 13013 denotes fcp service already started.
|
||||
if to_native(error.code) == "13013":
|
||||
return None
|
||||
else:
|
||||
self.module.fail_json(msg='Error starting FCP %s' % (to_native(error)),
|
||||
exception=traceback.format_exc())
|
||||
|
||||
def stop_fcp(self):
|
||||
"""
|
||||
|
@ -164,6 +167,9 @@ class NetAppOntapFCP(object):
|
|||
exception=traceback.format_exc())
|
||||
|
||||
def apply(self):
|
||||
results = netapp_utils.get_cserver(self.server)
|
||||
cserver = netapp_utils.setup_na_ontap_zapi(module=self.module, vserver=results)
|
||||
netapp_utils.ems_log_event("na_ontap_fcp", cserver)
|
||||
exists = self.get_fcp()
|
||||
changed = False
|
||||
if self.parameters['state'] == 'present':
|
||||
|
@ -180,6 +186,8 @@ class NetAppOntapFCP(object):
|
|||
self.create_fcp()
|
||||
if self.parameters['status'] == 'up':
|
||||
self.start_fcp()
|
||||
elif self.parameters['status'] == 'down':
|
||||
self.stop_fcp()
|
||||
changed = True
|
||||
else:
|
||||
if exists:
|
||||
|
|
Loading…
Reference in a new issue