Prompt for IOM1 or IOM2 in serial system check workflow
Mirrors the same change made to option 1 — asks which IOM the serial cable is connected to after login, then uses that selection in all Redfish paths for network settings, IOM firmware, and Fabric Card firmware. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -113,30 +113,42 @@ def _check_via_serial():
|
||||
time.sleep(2)
|
||||
return
|
||||
|
||||
rule("Querying IOM1 Status")
|
||||
info("Querying IOM1 network settings and firmware versions via serial console...")
|
||||
info("Note: only IOM1 is reachable over the serial connection.")
|
||||
# Prompt for which IOM the serial cable is connected to
|
||||
print()
|
||||
print(" Which IOM is the serial cable connected to?")
|
||||
print(f" {_c(C.BOLD, '1')} IOM1")
|
||||
print(f" {_c(C.BOLD, '2')} IOM2")
|
||||
print()
|
||||
while True:
|
||||
iom_choice = prompt("Select [1/2]")
|
||||
if iom_choice in ("1", "2"):
|
||||
break
|
||||
warn("Please enter 1 or 2.")
|
||||
iom = "IOM1" if iom_choice == "1" else "IOM2"
|
||||
|
||||
rule(f"Querying {iom} Status")
|
||||
info(f"Querying {iom} network settings and firmware versions via serial console...")
|
||||
print()
|
||||
|
||||
# ── Network settings ───────────────────────────────────────────────────────
|
||||
net_ok, net_data = _serial_redfish_request(
|
||||
ser, password, "GET",
|
||||
"/redfish/v1/Managers/IOM1/EthernetInterfaces/1",
|
||||
f"/redfish/v1/Managers/{iom}/EthernetInterfaces/1",
|
||||
)
|
||||
if net_ok and isinstance(net_data, dict):
|
||||
dhcp, ip, gw, nm, mac, hostname, link = _parse_network_data(net_data)
|
||||
mode = _c(C.CYN, "DHCP") if dhcp else _c(C.GRN, "Static")
|
||||
net_rows = [["IOM1", mode, ip, gw, nm, link]]
|
||||
iface_rows = [["IOM1", mac, hostname]]
|
||||
net_rows = [[iom, mode, ip, gw, nm, link]]
|
||||
iface_rows = [[iom, mac, hostname]]
|
||||
else:
|
||||
net_rows = [["IOM1", _c(C.RED, "No response"), "--", "--", "--", "--"]]
|
||||
iface_rows = [["IOM1", "--", "--"]]
|
||||
error(f"IOM1 network query failed: {net_data}")
|
||||
net_rows = [[iom, _c(C.RED, "No response"), "--", "--", "--", "--"]]
|
||||
iface_rows = [[iom, "--", "--"]]
|
||||
error(f"{iom} network query failed: {net_data}")
|
||||
|
||||
# ── IOM firmware version ───────────────────────────────────────────────────
|
||||
iom_ok, iom_data = _serial_redfish_request(
|
||||
ser, password, "GET",
|
||||
"/redfish/v1/Managers/IOM1",
|
||||
f"/redfish/v1/Managers/{iom}",
|
||||
)
|
||||
iom_ver = (
|
||||
iom_data.get("FirmwareVersion", "Unknown")
|
||||
@@ -147,7 +159,7 @@ def _check_via_serial():
|
||||
# ── Fabric card firmware version ───────────────────────────────────────────
|
||||
fab_ok, fab_data = _serial_redfish_request(
|
||||
ser, password, "GET",
|
||||
"/redfish/v1/Chassis/IOM1/NetworkAdapters/1",
|
||||
f"/redfish/v1/Chassis/{iom}/NetworkAdapters/1",
|
||||
)
|
||||
fab_ver = (
|
||||
(fab_data.get("Oem", {})
|
||||
@@ -158,7 +170,7 @@ def _check_via_serial():
|
||||
else _c(C.RED, "Unreachable")
|
||||
)
|
||||
|
||||
_print_results(net_rows, iface_rows, [["IOM1", iom_ver, fab_ver]])
|
||||
_print_results(net_rows, iface_rows, [[iom, iom_ver, fab_ver]])
|
||||
close_serial_connection(ser, device)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user