@@ -101,9 +101,6 @@ def __init__(
101101 self .keyjar = keyjar or KeyJar ()
102102 self .cwd = cwd
103103
104- # client database
105- self .cdb = client_db or {}
106-
107104 try :
108105 self .seed = bytes (conf ["seed" ], "utf-8" )
109106 except KeyError :
@@ -129,6 +126,9 @@ def __init__(
129126 # arguments for endpoints add-ons
130127 self .args = {}
131128
129+ # client database
130+ self .cdb = client_db or {}
131+
132132 # session db
133133 self ._sub_func = {}
134134 self .do_sub_func ()
@@ -217,22 +217,19 @@ def __init__(
217217 self .registration_access_token = {}
218218
219219 def set_session_db (self , conf , sso_db = None ):
220- # this populate self.sdb
221220 sso_db = sso_db if sso_db else SSODb ()
222221 self .do_session_db (conf , sso_db )
223- # this append useinfo db to the session db
222+ # append useinfo db to the session db
224223 self .do_userinfo ()
225224 logger .debug ('Session DB: {}' .format (self .sdb .__dict__ ))
226225
227226 def do_add_on (self ):
228- _conf = self .conf .get ("add_on" )
229- if 'add_on' in self .conf :
227+ if self .conf .get ("add_on" ):
230228 for spec in self .conf ["add_on" ].values ():
231229 if isinstance (spec ["function" ], str ):
232230 _func = importer (spec ["function" ])
233231 else :
234232 _func = spec ["function" ]
235-
236233 _func (self .endpoint , ** spec ["kwargs" ])
237234
238235 def do_login_hint2acrs (self ):
@@ -256,7 +253,9 @@ def do_userinfo(self):
256253 if self .sdb :
257254 self .userinfo = init_user_info (_conf , self .cwd )
258255 self .sdb .userinfo = self .userinfo
259-
256+ else :
257+ logger .warning (('Cannot init_user_info if any '
258+ 'session_db was provided.' ))
260259
261260 def do_id_token (self ):
262261 _conf = self .conf .get ("id_token" )
0 commit comments