Skip to content

Commit

Permalink
Update LLDP hostname for Chassis hostanme if present.
Browse files Browse the repository at this point in the history
Signed-off-by: Abhishek Dosi <[email protected]>
  • Loading branch information
abdosi committed May 25, 2024
1 parent 4fa405c commit b80b20e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dockers/docker-lldp/lldpmgrd
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,10 @@ class LldpManager(daemon_base.DaemonBase):
if not op in ["SET", "DEL"]:
return
self.log_info("Device Config Opcode: {} Dict {} Key {}".format(op, device_dict, key))
hostname = device_dict.get("hostname")
try:
hostname = device_dict["chassis_hostname"]
except:
hostname = device_dict.get("hostname")
if not self.hostname == hostname:
self.log_info("Hostname changed old {0}, new {1}".format(self.hostname, hostname))
self.update_hostname(hostname)
Expand Down

0 comments on commit b80b20e

Please sign in to comment.