From b80b20e6562095b9795fac403894d9aeba0c2be2 Mon Sep 17 00:00:00 2001 From: Abhishek Dosi Date: Sat, 25 May 2024 19:59:01 +0000 Subject: [PATCH] Update LLDP hostname for Chassis hostanme if present. Signed-off-by: Abhishek Dosi --- dockers/docker-lldp/lldpmgrd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dockers/docker-lldp/lldpmgrd b/dockers/docker-lldp/lldpmgrd index 2ee9c897c45a..8d0333ab6070 100755 --- a/dockers/docker-lldp/lldpmgrd +++ b/dockers/docker-lldp/lldpmgrd @@ -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)