Skip to content

Commit 0328f18

Browse files
mlok-nokiamssonicbld
authored andcommitted
[chassis][lldp] Fix the lldp error log in host instance which doesn't contain front panel ports (sonic-net#14814)
* [chassis][lldp] Fix the lldp error log in host instance which doesn't contain front pannel ports --------- Signed-off-by: mlok <[email protected]>
1 parent 143814c commit 0328f18

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

dockers/docker-lldp/lldpmgrd

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ try:
2323
from sonic_py_common import daemon_base
2424
from swsscommon import swsscommon
2525
from sonic_py_common.interface import inband_prefix, recirc_prefix
26+
from sonic_py_common import device_info
27+
2628
except ImportError as err:
2729
raise ImportError("%s - required module not found" % str(err))
2830

@@ -357,7 +359,8 @@ def run_cmd(self, cmd):
357359

358360
def check_timeout(self, start_time):
359361
if time.time() - start_time > PORT_INIT_TIMEOUT:
360-
self.log_error("Port init timeout reached ({} seconds), resuming lldpd...".format(PORT_INIT_TIMEOUT))
362+
if device_info.is_frontend_port_present_in_host():
363+
self.log_error("Port init timeout reached ({} seconds), resuming lldpd...".format(PORT_INIT_TIMEOUT))
361364
return True
362365
return False
363366

src/sonic-py-common/sonic_py_common/device_info.py

+10
Original file line numberDiff line numberDiff line change
@@ -712,3 +712,13 @@ def is_fast_reboot_enabled():
712712

713713
state_db.close(state_db.STATE_DB)
714714
return fb_enable_state
715+
716+
717+
def is_frontend_port_present_in_host():
718+
if is_supervisor():
719+
return False
720+
if is_multi_npu():
721+
namespace_id = os.getenv("NAMESPACE_ID")
722+
if not namespace_id:
723+
return False
724+
return True

0 commit comments

Comments
 (0)