From 8d36fdc99c333a60c78ccd1edcf94fea1bc56c7c Mon Sep 17 00:00:00 2001 From: Faiyaz Ahmed Date: Fri, 14 Mar 2008 20:53:12 +0000 Subject: [PATCH] Keep session around instead of calling the API for a new one every time a call is made. --- source/BootAPI.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.45.2