Skip to content

Commit cf32a7a

Browse files
authored
Reduce syslog warnings when ConfigDB has no management ports (sonic-net#115)
* Ignore LLDP peer emtpy mgmt address * No warning if no managment ports found
1 parent 875831e commit cf32a7a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/sonic_ax_impl/mibs/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def init_mgmt_interface_tables(db_conn):
165165
mgmt_ports_keys = db_conn.keys(CONFIG_DB, mgmt_if_entry_table(b'*'))
166166

167167
if not mgmt_ports_keys:
168-
logger.warning('No managment ports found in {}'.format(mgmt_if_entry_table(b'')))
168+
logger.debug('No managment ports found in {}'.format(mgmt_if_entry_table(b'')))
169169
return {}, {}
170170

171171
mgmt_ports = [key.split(mgmt_if_entry_table(b''))[-1] for key in mgmt_ports_keys]

src/sonic_ax_impl/mibs/ieee802_1ab.py

+4
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,10 @@ def update_rem_if_mgmt(self, if_oid, if_name):
497497
return
498498
try:
499499
mgmt_ip_str = lldp_kvs[b'lldp_rem_man_addr'].decode()
500+
mgmt_ip_str = mgmt_ip_str.strip()
501+
if len(mgmt_ip_str) == 0:
502+
# the peer advertise an emtpy mgmt address
503+
return
500504
time_mark = int(lldp_kvs[b'lldp_rem_time_mark'])
501505
remote_index = int(lldp_kvs[b'lldp_rem_index'])
502506
subtype = self.get_subtype(mgmt_ip_str)

0 commit comments

Comments
 (0)