Skip to content

Commit

Permalink
[acl_loader] Fix a crash issue when appdb is not consistent with cfgdb (
Browse files Browse the repository at this point in the history
  • Loading branch information
taoyl-ms authored Feb 13, 2018
1 parent dac636f commit 2a0defb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions acl_loader/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ def read_sessions_info(self):
self.sessions_db_info = self.configdb.get_table(self.MIRROR_SESSION)
for key in self.sessions_db_info.keys():
app_db_info = self.appdb.get_all(self.appdb.APPL_DB, "{}:{}".format(self.MIRROR_SESSION, key))

status = app_db_info.get("status", "inactive")
if app_db_info:
status = app_db_info.get("status", "inactive")
else:
status = "error"
self.sessions_db_info[key]["status"] = status

def get_sessions_db_info(self):
Expand Down

0 comments on commit 2a0defb

Please sign in to comment.