mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-21 20:59:10 +00:00
Update check_availability_service to return data instead of boolean (#11504)
* Update check_availability_service to return data instead of boolean * Add changelog fragment
This commit is contained in:
parent
c05c31334b
commit
8729f563b3
2 changed files with 25 additions and 3 deletions
|
|
@ -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).
|
||||
|
|
@ -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