[chassis][lldp] Fix the lldp error log in host instance which doesn't contain front panel ports (#14814) (#15669)
* [chassis][lldp] Fix the lldp error log in host instance which doesn't contain front pannel ports --------- Signed-off-by: mlok <marty.lok@nokia.com> Co-authored-by: Marty Y. Lok <76118573+mlok-nokia@users.noreply.github.com>
This commit is contained in:
parent
e40436f55f
commit
3f59abd29b
@ -23,6 +23,8 @@ try:
|
|||||||
from sonic_py_common import daemon_base
|
from sonic_py_common import daemon_base
|
||||||
from swsscommon import swsscommon
|
from swsscommon import swsscommon
|
||||||
from sonic_py_common.interface import inband_prefix, recirc_prefix
|
from sonic_py_common.interface import inband_prefix, recirc_prefix
|
||||||
|
from sonic_py_common import device_info
|
||||||
|
|
||||||
except ImportError as err:
|
except ImportError as err:
|
||||||
raise ImportError("%s - required module not found" % str(err))
|
raise ImportError("%s - required module not found" % str(err))
|
||||||
|
|
||||||
@ -357,6 +359,7 @@ def run_cmd(self, cmd):
|
|||||||
|
|
||||||
def check_timeout(self, start_time):
|
def check_timeout(self, start_time):
|
||||||
if time.time() - start_time > PORT_INIT_TIMEOUT:
|
if time.time() - start_time > PORT_INIT_TIMEOUT:
|
||||||
|
if device_info.is_frontend_port_present_in_host():
|
||||||
self.log_error("Port init timeout reached ({} seconds), resuming lldpd...".format(PORT_INIT_TIMEOUT))
|
self.log_error("Port init timeout reached ({} seconds), resuming lldpd...".format(PORT_INIT_TIMEOUT))
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
@ -682,3 +682,13 @@ def is_fast_reboot_enabled():
|
|||||||
|
|
||||||
state_db.close(state_db.STATE_DB)
|
state_db.close(state_db.STATE_DB)
|
||||||
return fb_enable_state
|
return fb_enable_state
|
||||||
|
|
||||||
|
|
||||||
|
def is_frontend_port_present_in_host():
|
||||||
|
if is_supervisor():
|
||||||
|
return False
|
||||||
|
if is_multi_npu():
|
||||||
|
namespace_id = os.getenv("NAMESPACE_ID")
|
||||||
|
if not namespace_id:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
Reference in New Issue
Block a user