mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-22 05:09:12 +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
|
: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
|
# Get the service root
|
||||||
# Override the timeout since the service root is expected to be readily
|
# Override the timeout since the service root is expected to be readily available.
|
||||||
# available.
|
|
||||||
service_root = self.get_request(self.root_uri + self.service_root, timeout=10)
|
service_root = self.get_request(self.root_uri + self.service_root, timeout=10)
|
||||||
if service_root["ret"] is False:
|
if service_root["ret"] is False:
|
||||||
# Failed, either due to a timeout or HTTP error; not available
|
# Failed, either due to a timeout or HTTP error; not available
|
||||||
return {"ret": True, "available": False}
|
return {"ret": True, "available": False}
|
||||||
|
|
||||||
# Successfully accessed the service root; available
|
# 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):
|
def get_logs(self):
|
||||||
log_svcs_uri_list = []
|
log_svcs_uri_list = []
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue