X-Git-Url: http://git.onelab.eu/?p=monitor.git;a=blobdiff_plain;f=monitor%2Fgetsshkeys.py;h=1068c5ff1cead0ce50f274cd91eb95d577ba200f;hp=d362c9422a2fdacf80ca38ed77ae5b6f69f1d893;hb=7e1b0434bd1f865f7e9d8dff1cebd87d07a8d65d;hpb=a6ce2019442ad317b4b3898f800c7b09cd90642b diff --git a/monitor/getsshkeys.py b/monitor/getsshkeys.py index d362c94..1068c5f 100755 --- a/monitor/getsshkeys.py +++ b/monitor/getsshkeys.py @@ -15,17 +15,17 @@ except: print traceback.print_exc() auth = {'AuthMethod' : "anonymous"} -args = {} -args['known_hosts'] = os.environ['HOME'] + os.sep + ".ssh" + os.sep + "known_hosts" -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): + def __init__(self, args = None): + if not args: args = {} + args['known_hosts'] = os.environ['HOME'] + os.sep + ".ssh" + os.sep + "known_hosts" + 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'] self.args = args self.read_knownhosts() self.auth = auth