From: Marc Fiuczynski Date: Thu, 21 May 2009 01:49:47 +0000 (+0000) Subject: auth fix X-Git-Tag: PLCAPI-4.3-15~13 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=0a3159ac826bb3d94efeef7032150819823ae3e7;p=plcapi.git auth fix --- diff --git a/PLC/Auth.py b/PLC/Auth.py index f056552b..87936934 100644 --- a/PLC/Auth.py +++ b/PLC/Auth.py @@ -36,6 +36,7 @@ def map_auth(auth): expected = AnonymousAuth() else: raise PLCInvalidArgument("must be 'session', 'password', 'gpg', 'hmac', 'hmac_dummybox', or 'anonymous'", "AuthMethod") + return expected class Auth(Parameter): """ diff --git a/PLC/Legacy/v42legacy.py b/PLC/Legacy/v42legacy.py index 5e6cdae8..2e170fc0 100644 --- a/PLC/Legacy/v42legacy.py +++ b/PLC/Legacy/v42legacy.py @@ -30,11 +30,13 @@ def make_class (legacyname,newname,path,import_deep,v42rename,v43rename): #print "%s: self.caller = %s, auth=%s, self.api=%s, self=%s" % (legacyname,self.caller,auth,self.api,self) if not hasattr(self,"auth"): self.auth = None + if self.auth == None and auth <> None: self.auth = auth - if self.auth <> None: + if self.auth <> None and self.caller == None: a = PLC.Auth.map_auth(auth) + print "a = %s" % a a.check(self,auth,*args) newargs=[patch(x,v42rename) for x in args]