@@ -341,14 +341,15 @@ def sync(self, parsed_update):
341
341
logger .debug ("Initiating LLDPd sync to Redis..." )
342
342
343
343
# push local chassis data to APP DB
344
- chassis_update = parsed_update .pop ('local-chassis' )
345
- if chassis_update != self .chassis_cache :
346
- self .db_connector .delete (self .db_connector .APPL_DB ,
347
- LldpSyncDaemon .LLDP_LOC_CHASSIS_TABLE )
348
- for k , v in chassis_update .items ():
349
- self .db_connector .set (self .db_connector .APPL_DB ,
350
- LldpSyncDaemon .LLDP_LOC_CHASSIS_TABLE , k , v , blocking = True )
351
- logger .debug ("sync'd: {}" .format (json .dumps (chassis_update , indent = 3 )))
344
+ if parsed_update .has_key ('local-chassis' ):
345
+ chassis_update = parsed_update .pop ('local-chassis' )
346
+ if chassis_update != self .chassis_cache :
347
+ self .db_connector .delete (self .db_connector .APPL_DB ,
348
+ LldpSyncDaemon .LLDP_LOC_CHASSIS_TABLE )
349
+ for k , v in chassis_update .items ():
350
+ self .db_connector .set (self .db_connector .APPL_DB ,
351
+ LldpSyncDaemon .LLDP_LOC_CHASSIS_TABLE , k , v , blocking = True )
352
+ logger .debug ("sync'd: {}" .format (json .dumps (chassis_update , indent = 3 )))
352
353
353
354
new , changed , deleted = self .cache_diff (self .interfaces_cache , parsed_update )
354
355
# Delete LLDP_ENTRIES which were modified or are missing
0 commit comments