X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=monitor%2Fwrapper%2Fplc.py;fp=monitor%2Fwrapper%2Fplc.py;h=2f0f19daa63efd4fee8a116aaee9d96738f387f0;hb=1aa6b24594dc485d7232649c50e9773956a1492f;hp=d2d627fad32a347087b82ce1ff14f503e73339ed;hpb=924b7e5c530ecf25d4c5b002fa89ff73ef11f53c;p=monitor.git diff --git a/monitor/wrapper/plc.py b/monitor/wrapper/plc.py index d2d627f..2f0f19d 100644 --- a/monitor/wrapper/plc.py +++ b/monitor/wrapper/plc.py @@ -17,8 +17,12 @@ from monitor import database try: from monitor import config debug = config.debug + XMLRPC_SERVER=config.API_SERVER except: debug = False + # NOTE: this host is used by default when there are no auth files. + XMLRPC_SERVER="https://boot.planet-lab.org/PLCAPI/" + logger = logging.getLogger("monitor") class Auth: @@ -34,8 +38,6 @@ class Auth: 'AuthMethod' : 'password', 'AuthString' : password} -# NOTE: this host is used by default when there are no auth files. -XMLRPC_SERVER="https://boot.planet-lab.org/PLCAPI/" # NOTE: by default, use anonymous access, but if auth files are # configured, use them, with their auth definitions. @@ -54,8 +56,6 @@ except: auth = Auth() auth.server = XMLRPC_SERVER -api = xmlrpclib.Server(auth.server, verbose=False, allow_none=True) - global_error_count = 0 class PLC: @@ -84,6 +84,8 @@ class PLC: def __repr__(self): return self.api.__repr__() +api = PLC(auth.auth, auth.server) + class CachedPLC(PLC): def _param_to_str(self, name, *params):