mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-02-04 07:51:50 +00:00
Add support for multiple managers to get_manager_attributes command in idrac_redfish_info module (#11301)
* Update get_manager_attributes method to support systems with multiple managers present Fixes https://github.com/ansible-collections/community.general/issues/11294 * Add changelog fragment Pre-define reponse for get_manager_attributes method * Update changelogs/fragments/11301-idrac-info-multi-manager.yml Update per suggestion! Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/idrac_redfish_info.py Remove extra manager quantity check Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
20ba59cce6
commit
13035e2a2c
2 changed files with 7 additions and 1 deletions
2
changelogs/fragments/11301-idrac-info-multi-manager.yml
Normal file
2
changelogs/fragments/11301-idrac-info-multi-manager.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
minor_changes:
|
||||||
|
- idrac_redfish_info - add multiple manager support to ``GetManagerAttributes`` command (https://github.com/ansible-collections/community.general/pull/11294).
|
||||||
|
|
@ -138,10 +138,14 @@ from ansible_collections.community.general.plugins.module_utils.redfish_utils im
|
||||||
class IdracRedfishUtils(RedfishUtils):
|
class IdracRedfishUtils(RedfishUtils):
|
||||||
def get_manager_attributes(self):
|
def get_manager_attributes(self):
|
||||||
result = {}
|
result = {}
|
||||||
|
response = {}
|
||||||
manager_attributes = []
|
manager_attributes = []
|
||||||
properties = ["Attributes", "Id"]
|
properties = ["Attributes", "Id"]
|
||||||
|
|
||||||
response = self.get_request(self.root_uri + self.manager_uri)
|
if len(self.manager_uris) == 1:
|
||||||
|
response = self.get_request(f"{self.root_uri}{self.manager_uri}")
|
||||||
|
elif len(self.manager_uris) > 1:
|
||||||
|
response = self.get_request(f"{self.root_uri}/redfish/v1/Managers/iDRAC.Embedded.1", override_headers=None)
|
||||||
|
|
||||||
if response["ret"] is False:
|
if response["ret"] is False:
|
||||||
return response
|
return response
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue