Skip to content

Commit

Permalink
Reduce syslog warnings when ConfigDB has no management ports (sonic-n…
Browse files Browse the repository at this point in the history
…et#115)

* Ignore LLDP peer emtpy mgmt address
* No warning if no managment ports found
  • Loading branch information
qiluo-msft authored Oct 8, 2019
1 parent 875831e commit cf32a7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/sonic_ax_impl/mibs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def init_mgmt_interface_tables(db_conn):
mgmt_ports_keys = db_conn.keys(CONFIG_DB, mgmt_if_entry_table(b'*'))

if not mgmt_ports_keys:
logger.warning('No managment ports found in {}'.format(mgmt_if_entry_table(b'')))
logger.debug('No managment ports found in {}'.format(mgmt_if_entry_table(b'')))
return {}, {}

mgmt_ports = [key.split(mgmt_if_entry_table(b''))[-1] for key in mgmt_ports_keys]
Expand Down
4 changes: 4 additions & 0 deletions src/sonic_ax_impl/mibs/ieee802_1ab.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,10 @@ def update_rem_if_mgmt(self, if_oid, if_name):
return
try:
mgmt_ip_str = lldp_kvs[b'lldp_rem_man_addr'].decode()
mgmt_ip_str = mgmt_ip_str.strip()
if len(mgmt_ip_str) == 0:
# the peer advertise an emtpy mgmt address
return
time_mark = int(lldp_kvs[b'lldp_rem_time_mark'])
remote_index = int(lldp_kvs[b'lldp_rem_index'])
subtype = self.get_subtype(mgmt_ip_str)
Expand Down

0 comments on commit cf32a7a

Please sign in to comment.