Skip to content

Commit 2a0defb

Browse files
authored
[acl_loader] Fix a crash issue when appdb is not consistent with cfgdb (sonic-net#202)
1 parent dac636f commit 2a0defb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

acl_loader/main.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ def read_sessions_info(self):
115115
self.sessions_db_info = self.configdb.get_table(self.MIRROR_SESSION)
116116
for key in self.sessions_db_info.keys():
117117
app_db_info = self.appdb.get_all(self.appdb.APPL_DB, "{}:{}".format(self.MIRROR_SESSION, key))
118-
119-
status = app_db_info.get("status", "inactive")
118+
if app_db_info:
119+
status = app_db_info.get("status", "inactive")
120+
else:
121+
status = "error"
120122
self.sessions_db_info[key]["status"] = status
121123

122124
def get_sessions_db_info(self):

0 commit comments

Comments
 (0)