Surface per-IOM Redfish error details in network config query

Previously fetch_current_config silently dropped the error string when
an IOM failed to respond, showing only "No response". Now the specific
error (HTTP status, connection refused, timeout, etc.) is printed below
the table to aid diagnosis.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-17 17:23:56 -04:00
parent 3b14e7b3bc
commit 4e0a17429b

View File

@@ -809,6 +809,7 @@ def fetch_current_config(cfg: ShelfConfig) -> bool:
any_ok = False
rows = []
errors = []
for iom in ("IOM1", "IOM2"):
path = f"/redfish/v1/Managers/{iom}/EthernetInterfaces/1"
@@ -852,6 +853,7 @@ def fetch_current_config(cfg: ShelfConfig) -> bool:
rows.append([iom, mode_str, origin, ip, gateway, netmask])
else:
rows.append([iom, _c(C.RED, "No response"), "--", "--", "--", "--"])
errors.append((iom, str(data)))
draw_table(
["IOM", "Mode", "Origin", "IP Address", "Gateway", "Subnet Mask"],
@@ -860,6 +862,11 @@ def fetch_current_config(cfg: ShelfConfig) -> bool:
)
print()
if errors:
for iom, err in errors:
error(f"{iom} query failed: {err}")
print()
if not any_ok:
error("Neither IOM responded to the Redfish query.")
error("Check that the serial cable is connected and the IOM is booted.")