Fix old version of gather facts from crashing (#53696)
* Revert "changes to clusteR" This reverts commit 33ee1b71e4bc8435fb315762a871f8c4cb6c5f80. * Revert "changes to clusteR" This reverts commit 33ee1b71e4bc8435fb315762a871f8c4cb6c5f80. * Revert "Revert "changes to clusteR"" This reverts commitf1104a37b4
. * Revert "Revert "changes to clusteR"" This reverts commitf1104a37b4
. * Revert "documentation changes" This reverts commit 02c369d0414fdff492d90865c903bdade3174261. * Fix gather facts * Revert "Revert "documentation changes"" This reverts commit576a9b03de
.
This commit is contained in:
parent
503d197b09
commit
f43d97da8a
1 changed files with 31 additions and 27 deletions
|
@ -102,7 +102,7 @@ class NetAppONTAPGatherFacts(object):
|
|||
try:
|
||||
results = self.server.invoke_successfully(api_call, enable_tunneling=False)
|
||||
ontapi_version = results.get_child_content('minor-version')
|
||||
return ontapi_version
|
||||
return ontapi_version if ontapi_version is not None else '0'
|
||||
except netapp_utils.zapi.NaApiError as e:
|
||||
self.module.fail_json(msg="Error calling API %s: %s" %
|
||||
(api_call.to_string(), to_native(e)), exception=traceback.format_exc())
|
||||
|
@ -182,12 +182,10 @@ class NetAppONTAPGatherFacts(object):
|
|||
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_gather_facts", cserver)
|
||||
self.netapp_info['net_interface_info'] = self.get_generic_get_iter(
|
||||
'net-interface-get-iter',
|
||||
attribute='net-interface-info',
|
||||
field='interface-name',
|
||||
query={'max-records': '1024'}
|
||||
)
|
||||
|
||||
self.netapp_info['ontap_version'] = self.ontapi()
|
||||
|
||||
if self.netapp_info['ontap_version'] >= '140':
|
||||
self.netapp_info['nvme_info'] = self.get_generic_get_iter(
|
||||
'nvme-get-iter',
|
||||
attribute='nvme-target-service-info',
|
||||
|
@ -212,6 +210,14 @@ class NetAppONTAPGatherFacts(object):
|
|||
field='path',
|
||||
query={'max-records': '1024'}
|
||||
)
|
||||
|
||||
self.netapp_info['net_interface_info'] = self.get_generic_get_iter(
|
||||
'net-interface-get-iter',
|
||||
attribute='net-interface-info',
|
||||
field='interface-name',
|
||||
query={'max-records': '1024'}
|
||||
)
|
||||
|
||||
self.netapp_info['net_port_info'] = self.get_generic_get_iter(
|
||||
'net-port-get-iter',
|
||||
attribute='net-port-info',
|
||||
|
@ -285,8 +291,6 @@ class NetAppONTAPGatherFacts(object):
|
|||
query={'max-records': '1024'}
|
||||
)
|
||||
|
||||
self.netapp_info['ontap_version'] = self.ontapi()
|
||||
|
||||
return self.netapp_info
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue