Skip to content

Commit 6b26c2c

Browse files
authored
[LLDP][T2] Advertise Chassis Hostname when present. (#19076)
Why I did: For chassis Advertise Chassis Hostname instead of Line Card Hostname if available to LLDP peers. --------- Signed-off-by: Abhishek Dosi <[email protected]>
1 parent 0e2bfc4 commit 6b26c2c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dockers/docker-lldp/lldpmgrd

+4-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,10 @@ class LldpManager(daemon_base.DaemonBase):
245245
if not op in ["SET", "DEL"]:
246246
return
247247
self.log_info("Device Config Opcode: {} Dict {} Key {}".format(op, device_dict, key))
248-
hostname = device_dict.get("hostname")
248+
try:
249+
hostname = device_dict["chassis_hostname"]
250+
except:
251+
hostname = device_dict.get("hostname")
249252
if not self.hostname == hostname:
250253
self.log_info("Hostname changed old {0}, new {1}".format(self.hostname, hostname))
251254
self.update_hostname(hostname)

0 commit comments

Comments
 (0)