git://git.onelab.eu
/
monitor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
handle the case where there is no data in db yet.
[monitor.git]
/
getsshkeys.py
diff --git
a/getsshkeys.py
b/getsshkeys.py
index
eee1fdc
..
137ea68
100755
(executable)
--- a/
getsshkeys.py
+++ b/
getsshkeys.py
@@
-5,6
+5,15
@@
import sys
import string
import time
import xml, xmlrpclib
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 = {}
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()
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 = {}
self.api = xmlrpclib.Server(args['XMLRPC_SERVER'], verbose=False, allow_none=True)
self.nodenetworks = {}