X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=monitor%2Fwrapper%2Fplc.py;h=b681d55a77de5eeb58e6c4c6599743123ea6ba98;hb=40588e1f900ba82db3ca69c5cc375805028f2430;hp=8f70c1f6c0bf654e9a8e0daa0dd3649d69f272b7;hpb=16b7bc48471b0695e72320fbcf761db695af032e;p=monitor.git diff --git a/monitor/wrapper/plc.py b/monitor/wrapper/plc.py index 8f70c1f..b681d55 100644 --- a/monitor/wrapper/plc.py +++ b/monitor/wrapper/plc.py @@ -84,7 +84,6 @@ class PLC: def __repr__(self): return self.api.__repr__() -api = PLC(auth.auth, auth.server) class CachedPLC(PLC): @@ -132,6 +131,9 @@ class CachedPLC(PLC): return run_or_returncached +api = PLC(auth.auth, auth.server) +cacheapi = CachedPLC(auth.auth, auth.server) + def getAPI(url): return xmlrpclib.Server(url, verbose=False, allow_none=True) @@ -146,6 +148,13 @@ def getAuthAPI(): def getCachedAuthAPI(): return CachedPLC(auth.auth, auth.server) +def getSessionAPI(session, server): + nodeauth = Auth(session=session) + return PLC(nodeauth.auth, server) +def getUserAPI(username, password, server): + auth = Auth(username,password) + return PLC(auth.auth, server) + def getTechEmails(loginbase): """ For the given site, return all user email addresses that have the 'tech' role.