Fix documentation and facts_from_proxy value in the netapp_e_facts module. (#61072)

pull/61810/head
Nathan Swartz 5 years ago committed by ansibot
parent 44eaea9f80
commit 4c8407fb83

@ -16,10 +16,6 @@ module: netapp_e_facts
short_description: NetApp E-Series retrieve facts about NetApp E-Series storage arrays short_description: NetApp E-Series retrieve facts about NetApp E-Series storage arrays
description: description:
- The netapp_e_facts module returns a collection of facts regarding NetApp E-Series storage arrays. - The netapp_e_facts module returns a collection of facts regarding NetApp E-Series storage arrays.
- When contacting a storage array directly the collection includes details about the array, controllers, management
interfaces, hostside interfaces, driveside interfaces, disks, storage pools, volumes, snapshots, and features.
- When contacting a web services proxy the collection will include basic information regarding the storage systems
that are under its management.
version_added: '2.2' version_added: '2.2'
author: author:
- Kevin Hulquest (@hulquest) - Kevin Hulquest (@hulquest)
@ -32,18 +28,11 @@ EXAMPLES = """
--- ---
- name: Get array facts - name: Get array facts
netapp_e_facts: netapp_e_facts:
ssid: "{{ netapp_array_id }}" ssid: "1"
api_url: "https://{{ netapp_e_api_host }}:8443/devmgr/v2" api_url: "https://192.168.1.100:8443/devmgr/v2"
api_username: "{{ netapp_api_username }}" api_username: "admin"
api_password: "{{ netapp_api_password }}" api_password: "adminpass"
validate_certs: "{{ netapp_api_validate_certs }}" validate_certs: true
- name: Get array facts
netapp_e_facts:
ssid: 1
api_url: https://192.168.1.100:8443/devmgr/v2
api_username: myApiUser
api_password: myApiPass
validate_certs: true
""" """
RETURN = """ RETURN = """
@ -275,7 +264,7 @@ class Facts(NetAppESeriesModule):
def get_array_facts(self): def get_array_facts(self):
"""Extract particular facts from the storage array graph""" """Extract particular facts from the storage array graph"""
facts = dict(facts_from_proxy=False, ssid=self.ssid) facts = dict(facts_from_proxy=(not self.is_embedded()), ssid=self.ssid)
controller_reference_label = self.get_controllers() controller_reference_label = self.get_controllers()
array_facts = None array_facts = None
@ -283,8 +272,7 @@ class Facts(NetAppESeriesModule):
try: try:
rc, array_facts = self.request("storage-systems/%s/graph" % self.ssid) rc, array_facts = self.request("storage-systems/%s/graph" % self.ssid)
except Exception as error: except Exception as error:
self.module.fail_json(msg="Failed to obtain facts from storage array with id [%s]. Error [%s]" self.module.fail_json(msg="Failed to obtain facts from storage array with id [%s]. Error [%s]" % (self.ssid, str(error)))
% (self.ssid, str(error)))
facts['netapp_storage_array'] = dict( facts['netapp_storage_array'] = dict(
name=array_facts['sa']['saData']['storageArrayLabel'], name=array_facts['sa']['saData']['storageArrayLabel'],

@ -449,6 +449,7 @@ class FactsTest(ModuleTestCase):
"""Verify get_array_facts method returns expected results.""" """Verify get_array_facts method returns expected results."""
self._set_args() self._set_args()
facts = Facts() facts = Facts()
facts.is_embedded = lambda: True
with mock.patch(self.GET_CONTROLLERS_FUNC, return_value={"070000000000000000000001": "A", "070000000000000000000002": "B"}): with mock.patch(self.GET_CONTROLLERS_FUNC, return_value={"070000000000000000000001": "A", "070000000000000000000002": "B"}):
with mock.patch(self.REQUEST_FUNC, side_effect=[(200, self.GRAPH_RESPONSE), (200, self.WORKLOAD_RESPONSE)]): with mock.patch(self.REQUEST_FUNC, side_effect=[(200, self.GRAPH_RESPONSE), (200, self.WORKLOAD_RESPONSE)]):
self.assertEquals(facts.get_array_facts(), self.EXPECTED_GET_ARRAY_FACTS) self.assertEquals(facts.get_array_facts(), self.EXPECTED_GET_ARRAY_FACTS)

Loading…
Cancel
Save