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:
@@ -58,7 +58,7 @@ Updates IOM firmware and/or Fabric Card firmware over the network:
|
|||||||
|
|
||||||
### 3 — System Check (`workflow_check.py`)
|
### 3 — System Check (`workflow_check.py`)
|
||||||
Read-only diagnostic workflow — queries current network settings and firmware versions, makes no changes:
|
Read-only diagnostic workflow — queries current network settings and firmware versions, makes no changes:
|
||||||
- **Serial:** logs in via serial console, queries IOM1 only using `_serial_redfish_request()` (curl over the serial session); covers network settings, IOM firmware, and Fabric Card firmware. IOM2 is not reachable over serial.
|
- **Serial:** prompts for IOM1 or IOM2, logs in via serial console, queries the selected IOM using `_serial_redfish_request()` (curl over the serial session); covers network settings, IOM firmware, and Fabric Card firmware.
|
||||||
- **Network:** prompts for management IP(s), queries via direct HTTPS using `Admin` credentials; reuses `_redfish_request()`, `_get_iom_fw_version()`, `_get_fabric_fw_version()` from `redfish.py`
|
- **Network:** prompts for management IP(s), queries via direct HTTPS using `Admin` credentials; reuses `_redfish_request()`, `_get_iom_fw_version()`, `_get_fabric_fw_version()` from `redfish.py`
|
||||||
- Displays results in two tables: network configuration and firmware versions
|
- Displays results in two tables: network configuration and firmware versions
|
||||||
- User selects Serial, Network, or Cancel at the sub-menu prompt
|
- User selects Serial, Network, or Cancel at the sub-menu prompt
|
||||||
|
|||||||
@@ -113,30 +113,42 @@ def _check_via_serial():
|
|||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
return
|
return
|
||||||
|
|
||||||
rule("Querying IOM1 Status")
|
# Prompt for which IOM the serial cable is connected to
|
||||||
info("Querying IOM1 network settings and firmware versions via serial console...")
|
print()
|
||||||
info("Note: only IOM1 is reachable over the serial connection.")
|
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()
|
print()
|
||||||
|
|
||||||
# ── Network settings ───────────────────────────────────────────────────────
|
# ── Network settings ───────────────────────────────────────────────────────
|
||||||
net_ok, net_data = _serial_redfish_request(
|
net_ok, net_data = _serial_redfish_request(
|
||||||
ser, password, "GET",
|
ser, password, "GET",
|
||||||
"/redfish/v1/Managers/IOM1/EthernetInterfaces/1",
|
f"/redfish/v1/Managers/{iom}/EthernetInterfaces/1",
|
||||||
)
|
)
|
||||||
if net_ok and isinstance(net_data, dict):
|
if net_ok and isinstance(net_data, dict):
|
||||||
dhcp, ip, gw, nm, mac, hostname, link = _parse_network_data(net_data)
|
dhcp, ip, gw, nm, mac, hostname, link = _parse_network_data(net_data)
|
||||||
mode = _c(C.CYN, "DHCP") if dhcp else _c(C.GRN, "Static")
|
mode = _c(C.CYN, "DHCP") if dhcp else _c(C.GRN, "Static")
|
||||||
net_rows = [["IOM1", mode, ip, gw, nm, link]]
|
net_rows = [[iom, mode, ip, gw, nm, link]]
|
||||||
iface_rows = [["IOM1", mac, hostname]]
|
iface_rows = [[iom, mac, hostname]]
|
||||||
else:
|
else:
|
||||||
net_rows = [["IOM1", _c(C.RED, "No response"), "--", "--", "--", "--"]]
|
net_rows = [[iom, _c(C.RED, "No response"), "--", "--", "--", "--"]]
|
||||||
iface_rows = [["IOM1", "--", "--"]]
|
iface_rows = [[iom, "--", "--"]]
|
||||||
error(f"IOM1 network query failed: {net_data}")
|
error(f"{iom} network query failed: {net_data}")
|
||||||
|
|
||||||
# ── IOM firmware version ───────────────────────────────────────────────────
|
# ── IOM firmware version ───────────────────────────────────────────────────
|
||||||
iom_ok, iom_data = _serial_redfish_request(
|
iom_ok, iom_data = _serial_redfish_request(
|
||||||
ser, password, "GET",
|
ser, password, "GET",
|
||||||
"/redfish/v1/Managers/IOM1",
|
f"/redfish/v1/Managers/{iom}",
|
||||||
)
|
)
|
||||||
iom_ver = (
|
iom_ver = (
|
||||||
iom_data.get("FirmwareVersion", "Unknown")
|
iom_data.get("FirmwareVersion", "Unknown")
|
||||||
@@ -147,7 +159,7 @@ def _check_via_serial():
|
|||||||
# ── Fabric card firmware version ───────────────────────────────────────────
|
# ── Fabric card firmware version ───────────────────────────────────────────
|
||||||
fab_ok, fab_data = _serial_redfish_request(
|
fab_ok, fab_data = _serial_redfish_request(
|
||||||
ser, password, "GET",
|
ser, password, "GET",
|
||||||
"/redfish/v1/Chassis/IOM1/NetworkAdapters/1",
|
f"/redfish/v1/Chassis/{iom}/NetworkAdapters/1",
|
||||||
)
|
)
|
||||||
fab_ver = (
|
fab_ver = (
|
||||||
(fab_data.get("Oem", {})
|
(fab_data.get("Oem", {})
|
||||||
@@ -158,7 +170,7 @@ def _check_via_serial():
|
|||||||
else _c(C.RED, "Unreachable")
|
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)
|
close_serial_connection(ser, device)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user