Skip to content

Commit e1f6b39

Browse files
committed
Added support for showing ServiceIdentification in the output of 'rf_discover.py'
Signed-off-by: Mike Raineri <[email protected]>
1 parent 508d186 commit e1f6b39

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scripts/rf_discover.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@
3838
groups = re.search(r"^(.+)\/redfish\/v1\/?$", services[service])
3939
url = groups.group(1)
4040
redfish_obj = redfish.redfish_client(base_url=url, timeout=15, max_retry=3)
41-
print("{}: {} ({})".format(service, services[service], redfish_obj.root["Product"]))
41+
product = "N/A"
42+
if "Product" in redfish_obj.root:
43+
product = redfish_obj.root["Product"]
44+
identification = "N/A"
45+
if "ServiceIdentification" in redfish_obj.root:
46+
identification = redfish_obj.root["ServiceIdentification"]
47+
print("{}: {} ({}, {})".format(service, services[service], product, identification))
4248
except Exception:
4349
print("{}: {}".format(service, services[service]))
4450

0 commit comments

Comments
 (0)