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 commit f1104a37b4.

* Revert "Revert "changes to clusteR""

This reverts commit f1104a37b4.

* Revert "documentation changes"

This reverts commit 02c369d0414fdff492d90865c903bdade3174261.

* Fix gather facts

* Revert "Revert "documentation changes""

This reverts commit 576a9b03de.
pull/54452/head
Chris Archibald 6 years ago committed by John R Barker
parent 503d197b09
commit f43d97da8a

@ -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,36 +182,42 @@ 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['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',
field='vserver',
query={'max-records': '1024'}
)
self.netapp_info['nvme_interface_info'] = self.get_generic_get_iter(
'nvme-interface-get-iter',
attribute='nvme-interface-info',
field='vserver',
query={'max-records': '1024'}
)
self.netapp_info['nvme_subsystem_info'] = self.get_generic_get_iter(
'nvme-subsystem-get-iter',
attribute='nvme-subsystem-info',
field='subsystem',
query={'max-records': '1024'}
)
self.netapp_info['nvme_namespace_info'] = self.get_generic_get_iter(
'nvme-namespace-get-iter',
attribute='nvme-namespace-info',
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['nvme_info'] = self.get_generic_get_iter(
'nvme-get-iter',
attribute='nvme-target-service-info',
field='vserver',
query={'max-records': '1024'}
)
self.netapp_info['nvme_interface_info'] = self.get_generic_get_iter(
'nvme-interface-get-iter',
attribute='nvme-interface-info',
field='vserver',
query={'max-records': '1024'}
)
self.netapp_info['nvme_subsystem_info'] = self.get_generic_get_iter(
'nvme-subsystem-get-iter',
attribute='nvme-subsystem-info',
field='subsystem',
query={'max-records': '1024'}
)
self.netapp_info['nvme_namespace_info'] = self.get_generic_get_iter(
'nvme-namespace-get-iter',
attribute='nvme-namespace-info',
field='path',
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…
Cancel
Save