X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=getsshkeys.py;h=d362c9422a2fdacf80ca38ed77ae5b6f69f1d893;hb=7e1b0434bd1f865f7e9d8dff1cebd87d07a8d65d;hp=0819abeeddb003f4e5df3406f90cc9b47fef58b4;hpb=77f84f1e8242cdc45eb091ab65eef940a23493a6;p=monitor.git diff --git a/getsshkeys.py b/getsshkeys.py index 0819abe..d362c94 100755 --- a/getsshkeys.py +++ b/getsshkeys.py @@ -5,17 +5,30 @@ import sys import string import time import xml, xmlrpclib +try: + from monitor import config + auth = {'Username' : config.API_AUTH_USER, + 'AuthMethod' : "password", + 'AuthString' : config.API_AUTH_PASSWORD} +except: + import traceback + print traceback.print_exc() + auth = {'AuthMethod' : "anonymous"} args = {} args['known_hosts'] = os.environ['HOME'] + os.sep + ".ssh" + os.sep + "known_hosts" -args['XMLRPC_SERVER'] = 'https://www.planet-lab.org/PLCAPI/' +try: + from monitor import config + args['XMLRPC_SERVER'] = config.API_SERVER +except: + args['XMLRPC_SERVER'] = 'https://boot.planet-lab.org/PLCAPI/' + print "Using default API server %s" % args['XMLRPC_SERVER'] class SSHKnownHosts: def __init__(self, args = args): self.args = args self.read_knownhosts() - self.auth = {} - self.auth['AuthMethod'] = "anonymous" + self.auth = auth self.api = xmlrpclib.Server(args['XMLRPC_SERVER'], verbose=False, allow_none=True) self.nodenetworks = {}