From d08604eebc1d5e037dc0b734f87cf71d4a452711 Mon Sep 17 00:00:00 2001 From: Piotr Olczak Date: Wed, 12 Dec 2018 12:47:19 +0100 Subject: [PATCH] Fixes 45136 and 47641: (#47642) - each volume in the volume_info should be identified by VOLUME_NAME:OWNING_VSERVER:AGGREGATE - do not fail if external key management is enabled --- .../modules/storage/netapp/na_ontap_gather_facts.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/storage/netapp/na_ontap_gather_facts.py b/lib/ansible/modules/storage/netapp/na_ontap_gather_facts.py index b66ff2d91a9..a3a14fe1bb2 100644 --- a/lib/ansible/modules/storage/netapp/na_ontap_gather_facts.py +++ b/lib/ansible/modules/storage/netapp/na_ontap_gather_facts.py @@ -108,8 +108,10 @@ class NetAppGatherFacts(object): result = self.server.invoke_successfully(api_call, enable_tunneling=False) return result except netapp_utils.zapi.NaApiError as e: - self.module.fail_json(msg="Error calling API %s: %s" % - (call, to_native(e)), exception=traceback.format_exc()) + if call in ['security-key-manager-key-get-iter']: + return result + else: + self.module.fail_json(msg="Error calling API %s: %s" % (call, to_native(e)), exception=traceback.format_exc()) def get_ifgrp_info(self): net_port_info = self.netapp_info['net_port_info'] @@ -133,6 +135,9 @@ class NetAppGatherFacts(object): def get_generic_get_iter(self, call, attribute=None, field=None, query=None, children='attributes-list'): generic_call = self.call_api(call, query) + if generic_call is None: + return None + if field is None: out = [] else: @@ -196,7 +201,7 @@ class NetAppGatherFacts(object): self.netapp_info['volume_info'] = self.get_generic_get_iter( 'volume-get-iter', attribute='volume-attributes', - field=('name', 'node', 'aggr-name'), + field=('name', 'owning-vserver-name', 'aggr-name'), query={'max-records': '1024'} ) self.netapp_info['lun_info'] = self.get_generic_get_iter( @@ -234,6 +239,7 @@ class NetAppGatherFacts(object): field=('node', 'key-id'), query={'max-records': '1024'} ) + self.netapp_info['vserver_info'] = self.get_generic_get_iter( 'vserver-get-iter', attribute='vserver-info',