Skip to content

Commit

Permalink
Improve error messages and fix missing f in f-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Keay committed Dec 18, 2024
1 parent b581118 commit 58d9258
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ def bmc_set_permanent_ip_addr(bmc: Bmc, interface_info: InterfaceInfo):
"IPv4.1.Netmask": str(interface_info.ipv4_address.netmask),
}
}
logger.info("BMC was DHCP, setting permanent {interface_info.ipv4_address}")
logger.info(
f"BMC was DHCP IP {interface_info.ipv4_address}, making this permanent"
)
bmc.redfish_request(REDFISH_PATH, method="PATCH", payload=payload)
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ def switches_for(nautobot, chassis_info: ChassisInfo) -> dict[str, dict]:
}
switches = nautobot_switches(nautobot, switch_macs.union(base_switch_macs))
if not switches:
raise Exception("No switches found in nautobot for {switch_macs}")
raise Exception(
f"There are no switch Devices in nautobot that match the LLDP info "
f"reported by server BMC - I found no Devices where "
f"chassis_mac_address is one of {switch_macs}"
)
return switches


Expand Down

0 comments on commit 58d9258

Please sign in to comment.