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:
parent
cb17703c36
commit
b87121e1eb
2 changed files with 25 additions and 3 deletions
|
|
@ -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 = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue