From: Faiyaz Ahmed Date: Fri, 14 Mar 2008 20:53:12 +0000 (+0000) Subject: Keep session around instead of calling the API for a new one every time a call is... X-Git-Tag: BootManager-3.2-5~8 X-Git-Url: http://git.onelab.eu/?p=bootmanager.git;a=commitdiff_plain;h=8d36fdc99c333a60c78ccd1edcf94fea1bc56c7c Keep session around instead of calling the API for a new one every time a call is made. --- diff --git a/source/BootAPI.py b/source/BootAPI.py index 183838c..8bb3c26 100644 --- a/source/BootAPI.py +++ b/source/BootAPI.py @@ -45,12 +45,18 @@ def create_auth_structure( vars, call_params ): auth['value']= node_hmac try: auth_session = {} - auth_session['session'] = vars['API_SERVER_INST'].GetSession(auth) + if not vars.has_key('SESSION'): + session = vars['API_SERVER_INST'].GetSession(auth) + auth_session['session'] = session + vars['SESSION'] = session + else: + auth_session['session'] = vars['SESSION'] auth_session['AuthMethod'] = 'session' auth = auth_session except Exception, e: print e pass + print auth return auth