X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=getsshkeys.py;h=137ea68742e3aa1877905f8423e1d787a92b4ca9;hb=d428ca60fd1eb7283291b8f47cdd86dce4986925;hp=eee1fdc8acf87b256ac7358bea20f5a95de57dda;hpb=d0652340b89d51c6115edb13d5c7c72b34dea66f;p=monitor.git diff --git a/getsshkeys.py b/getsshkeys.py index eee1fdc..137ea68 100755 --- a/getsshkeys.py +++ b/getsshkeys.py @@ -5,6 +5,15 @@ 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" @@ -14,8 +23,7 @@ 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 = {}