X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmethods%2Fget_key.py;h=638332e92752b191aa141cc5bec31e60078486ba;hb=2b3c0c7ebe7c55afb14e3ea3aed10f8b1abe01e7;hp=5e3f3fd63108ae02f30a635202b33bcd16e2f53e;hpb=dbce495b6f2e7d8dccbfb18c5507907d784c143b;p=sfa.git diff --git a/sfa/methods/get_key.py b/sfa/methods/get_key.py index 5e3f3fd6..638332e9 100644 --- a/sfa/methods/get_key.py +++ b/sfa/methods/get_key.py @@ -1,13 +1,10 @@ -### $Id: $ -### $URL: $ import os import tempfile import commands -from sfa.util.faults import * -from sfa.util.namespace import hrn_to_urn +from sfa.util.faults import NonExistingRecord, RecordNotFound +from sfa.util.xrn import hrn_to_urn from sfa.util.method import Method -from sfa.util.parameter import Parameter, Mixed -from sfa.trust.auth import Auth +from sfa.util.parameter import Parameter from sfa.util.table import SfaTable from sfa.trust.certificate import Keypair from sfa.trust.gid import create_uuid @@ -28,10 +25,10 @@ class get_key(Method): # verify that the callers's ip address exist in the db and is an inteface # for a node in the db (ip, port) = self.api.remote_addr - interfaces = self.api.plshell.GetInterfaces(self.api.plauth, {'ip': ip}, ['node_id']) + interfaces = self.api.driver.GetInterfaces({'ip': ip}, ['node_id']) if not interfaces: raise NonExistingRecord("no such ip %(ip)s" % locals()) - nodes = self.api.plshell.GetNodes(self.api.plauth, [interfaces[0]['node_id']], ['node_id', 'hostname']) + nodes = self.api.driver.GetNodes([interfaces[0]['node_id']], ['node_id', 'hostname']) if not nodes: raise NonExistingRecord("no such node using ip %(ip)s" % locals()) node = nodes[0]