X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=getsshkeys.py;h=eae58835aeb5098fa46ef4f2329e34682504ee86;hb=refs%2Fheads%2F1.0;hp=9f1d835fa0ee4c694221a853a4ad9ef4a9bbd641;hpb=e665cbf24eab6d9ce9fd80b90d6625ca17087ab8;p=monitor.git diff --git a/getsshkeys.py b/getsshkeys.py index 9f1d835..eae5883 100755 --- a/getsshkeys.py +++ b/getsshkeys.py @@ -22,7 +22,7 @@ try: 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'] + print "Using default API server %s" % args['XMLRPC_SERVER'] class SSHKnownHosts: def __init__(self, args = args): @@ -135,27 +135,27 @@ class SSHKnownHosts: if type(host) == type(""): host = [host] # get the node(s) info - nodes = self.api.GetNodes(self.auth,host,["hostname","ssh_rsa_key","nodenetwork_ids"]) + nodes = self.api.GetNodes(self.auth,host,["hostname","ssh_rsa_key","interface_ids"]) # for each node's node network, update the self.nodenetworks cache nodenetworks = [] for node in nodes: - for net in node["nodenetwork_ids"]: + for net in node["interface_ids"]: nodenetworks.append(net) - plcnodenetworks = self.api.GetNodeNetworks(self.auth,nodenetworks,["nodenetwork_id","ip"]) + plcnodenetworks = self.api.GetInterfaces(self.auth,nodenetworks,["interface_id","ip"]) for n in plcnodenetworks: - self.nodenetworks[n["nodenetwork_id"]]=n + self.nodenetworks[n["interface_id"]]=n return nodes def _record_from_node(self, node, nokey_list=None): host = node['hostname'] key = node['ssh_rsa_key'] - nodenetworks = node['nodenetwork_ids'] + nodenetworks = node['interface_ids'] if len(nodenetworks)==0: return (host, None, None, None) - # the [0] subscript to node['nodenetwork_ids'] means + # the [0] subscript to node['interface_ids'] means # that this function wont work with multihomed nodes l_nw = self.nodenetworks.get(nodenetworks[0],None) if l_nw is None: return (host, None, None, None)