From 2a0defb2373ad88c85e34981a728b2d4b96b1883 Mon Sep 17 00:00:00 2001 From: Taoyu Li Date: Mon, 12 Feb 2018 17:43:10 -0800 Subject: [PATCH] [acl_loader] Fix a crash issue when appdb is not consistent with cfgdb (#202) --- acl_loader/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/acl_loader/main.py b/acl_loader/main.py index a3b05e8d4a..72929f6320 100644 --- a/acl_loader/main.py +++ b/acl_loader/main.py @@ -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):