Add multi-shelf support to firmware update workflow

The firmware update workflow now supports updating any number of shelves in a
single run. After entering IPs for the first shelf, the user is prompted to
add another; this repeats until done. Firmware file and update-type choices
are made once and applied to all shelves sequentially.

_show_fw_versions() updated to accept (label, iom, ip) tuples so the display
label and Redfish path name can differ for multi-shelf tables (e.g. "S1 / IOM1"
vs "IOM1"). Pre- and post-update version tables include the shelf number when
more than one shelf is being updated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-18 08:20:48 -04:00
parent 47157ba502
commit 10354794f8
2 changed files with 77 additions and 23 deletions

View File

@@ -214,17 +214,24 @@ def _get_fabric_fw_version(password: str, host: str, iom: str) -> str:
return _c(C.RED, "Unreachable")
def _show_fw_versions(password: str, ioms: list):
def _show_fw_versions(password: str, targets: list):
"""
Query and display firmware versions.
targets: list of (label, iom, ip) tuples where
label: display string (e.g. "IOM1", "S1 / IOM1")
iom: actual IOM name used in Redfish paths ("IOM1" or "IOM2")
ip: management IP address
"""
info("Querying firmware versions...")
rows = []
for iom, ip in ioms:
for label, iom, ip in targets:
iom_ver = _get_iom_fw_version(password, ip, iom)
fabric_ver = _get_fabric_fw_version(password, ip, iom)
rows.append([iom, ip, iom_ver, fabric_ver])
rows.append([label, ip, iom_ver, fabric_ver])
print()
draw_table(
["IOM", "IP Address", "IOM Firmware", "Fabric Firmware"],
rows,
[5, 16, 32, 20],
[12, 16, 32, 20],
)
print()