Prefer FQDN over HostName for IOM hostname display
Some IOMs (IOM1) return a UUID in the HostName field of EthernetInterfaces/1. The FQDN field is more reliably populated with the actual hostname. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -54,7 +54,8 @@ def _parse_network_data(data: dict) -> tuple:
|
|||||||
ip = gateway = netmask = "--"
|
ip = gateway = netmask = "--"
|
||||||
|
|
||||||
mac = _sanitize(data.get("MACAddress", "--"))
|
mac = _sanitize(data.get("MACAddress", "--"))
|
||||||
hostname = _sanitize(data.get("HostName", "--"))
|
# Prefer FQDN over HostName — some IOMs return a UUID in HostName
|
||||||
|
hostname = _sanitize(data.get("FQDN") or data.get("HostName") or "--")
|
||||||
link_status = _sanitize(data.get("LinkStatus", "--"))
|
link_status = _sanitize(data.get("LinkStatus", "--"))
|
||||||
|
|
||||||
return dhcp_enabled, ip, gateway, netmask, mac, hostname, link_status
|
return dhcp_enabled, ip, gateway, netmask, mac, hostname, link_status
|
||||||
|
|||||||
Reference in New Issue
Block a user