X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=blobdiff_plain;f=manifold%2Fmanifoldapi.py;h=b1a1a0cc10c1c2ad5e16747a416edb5b8411c286;hp=f8c33f98290d8ab61fcc7f9755462b9803f9bd87;hb=20e712f9703d8b2eaf226fdf8807315edcea6a9a;hpb=a1e452649acd9538b59dbf728dbc7b7ddec96749 diff --git a/manifold/manifoldapi.py b/manifold/manifoldapi.py index f8c33f98..b1a1a0cc 100644 --- a/manifold/manifoldapi.py +++ b/manifold/manifoldapi.py @@ -1,7 +1,7 @@ # Manifold API Python interface import copy, xmlrpclib -from myslice.config import Config +from myslice.configengine import ConfigEngine from django.contrib import messages from manifoldresult import ManifoldResult, ManifoldCode, ManifoldException @@ -39,8 +39,7 @@ class ManifoldAPI: self.trace = [] self.calls = {} self.multicall = False - config = Config() - self.url = config.manifold_url() + self.url = ConfigEngine().manifold_url() self.server = xmlrpclib.Server(self.url, verbose=False, allow_none=True) def __repr__ (self): return "ManifoldAPI[%s]"%self.url @@ -132,6 +131,9 @@ def _execute_query(request, query, manifold_api_session_auth): print "-"*80 result = manifold_api.forward(query.to_dict()) if result['code'] == 2: + # this is gross; at the very least we need to logout() + # but most importantly there is a need to refine that test, since + # code==2 does not necessarily mean an expired session # XXX only if we know it is the issue del request.session['manifold'] # Flush django session @@ -155,7 +157,6 @@ def execute_query(request, query): return _execute_query(request, query, manifold_api_session_auth) def execute_admin_query(request, query): - config = Config() - admin_user, admin_password = config.manifold_admin_user_password() + admin_user, admin_password = ConfigEngine().manifold_admin_user_password() admin_auth = {'AuthMethod': 'password', 'Username': admin_user, 'AuthString': admin_password} return _execute_query(request, query, admin_auth)