Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/lldp_syncd/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ def sync(self, parsed_update):
Sync LLDP information to redis DB.
"""
logger.debug("Initiating LLDPd sync to Redis...")

# First, delete all entries from the LLDP_ENTRY_TABLE
client = self.db_connector.redis_clients[self.db_connector.APPL_DB]
pattern = '{}:*'.format(LldpSyncDaemon.LLDP_ENTRY_TABLE)
self.db_connector.delete_all_by_pattern(self.db_connector.APPL_DB, pattern)

# Repopulate LLDP_ENTRY_TABLE by adding all elements from parsed_update
for interface, if_attributes in parsed_update.items():
if re.match(SONIC_ETHERNET_RE_PATTERN, interface) is None:
logger.warning("Ignoring interface '{}'".format(interface))
Expand Down