1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-22 05:09:12 +00:00

[PR #11504/8729f563 backport][stable-12] Update check_availability_service to return data instead of boolean (#11510)

Update check_availability_service to return data instead of boolean (#11504)

* Update check_availability_service to return data instead of boolean

* Add changelog fragment

(cherry picked from commit 8729f563b3)

Co-authored-by: Scott Seekamp <13857911+sseekamp@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2026-02-14 21:14:07 +01:00 committed by GitHub
parent cb17703c36
commit b87121e1eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 3 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- redfish_info - add Redfish Root data to results of successful ``CheckAvailability`` command (https://github.com/ansible-collections/community.general/pull/11504).

View file

@ -661,17 +661,37 @@ class RedfishUtils:
:return: dict containing the status of the service
"""
result = {}
service_root_data = {}
# Get these entries, but does not fail if not found
properties = [
"Id",
"Name",
"RedfishVersion",
"Vendor",
"ServiceIdentification",
"ProtocolFeaturesSupported",
"UUID",
]
# Get the service root
# Override the timeout since the service root is expected to be readily
# available.
# Override the timeout since the service root is expected to be readily available.
service_root = self.get_request(self.root_uri + self.service_root, timeout=10)
if service_root["ret"] is False:
# Failed, either due to a timeout or HTTP error; not available
return {"ret": True, "available": False}
# Successfully accessed the service root; available
return {"ret": True, "available": True}
result["ret"] = True
result["available"] = True
data = service_root["data"]
for property in properties:
if property in data:
service_root_data[property] = data[property]
result["entries"] = service_root_data
return result
def get_logs(self):
log_svcs_uri_list = []