1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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
This commit is contained in:
Piotr Olczak 2018-12-12 12:47:19 +01:00 committed by ansibot
parent 9d965906bd
commit d08604eebc

View file

@ -108,8 +108,10 @@ class NetAppGatherFacts(object):
result = self.server.invoke_successfully(api_call, enable_tunneling=False) result = self.server.invoke_successfully(api_call, enable_tunneling=False)
return result return result
except netapp_utils.zapi.NaApiError as e: except netapp_utils.zapi.NaApiError as e:
self.module.fail_json(msg="Error calling API %s: %s" % if call in ['security-key-manager-key-get-iter']:
(call, to_native(e)), exception=traceback.format_exc()) 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): def get_ifgrp_info(self):
net_port_info = self.netapp_info['net_port_info'] 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'): def get_generic_get_iter(self, call, attribute=None, field=None, query=None, children='attributes-list'):
generic_call = self.call_api(call, query) generic_call = self.call_api(call, query)
if generic_call is None:
return None
if field is None: if field is None:
out = [] out = []
else: else:
@ -196,7 +201,7 @@ class NetAppGatherFacts(object):
self.netapp_info['volume_info'] = self.get_generic_get_iter( self.netapp_info['volume_info'] = self.get_generic_get_iter(
'volume-get-iter', 'volume-get-iter',
attribute='volume-attributes', attribute='volume-attributes',
field=('name', 'node', 'aggr-name'), field=('name', 'owning-vserver-name', 'aggr-name'),
query={'max-records': '1024'} query={'max-records': '1024'}
) )
self.netapp_info['lun_info'] = self.get_generic_get_iter( self.netapp_info['lun_info'] = self.get_generic_get_iter(
@ -234,6 +239,7 @@ class NetAppGatherFacts(object):
field=('node', 'key-id'), field=('node', 'key-id'),
query={'max-records': '1024'} query={'max-records': '1024'}
) )
self.netapp_info['vserver_info'] = self.get_generic_get_iter( self.netapp_info['vserver_info'] = self.get_generic_get_iter(
'vserver-get-iter', 'vserver-get-iter',
attribute='vserver-info', attribute='vserver-info',