X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmethods%2Fget_key.py;h=c641985b6b71f31e62e02859434b95e44c9852b7;hb=3d7237fa0b5f2b4a60cb97c7fb3b6aecfd94558a;hp=15175f4ff65cd78cf28f0823bcede712e890f148;hpb=a94775b8e617fa671bba2ce49d2be01ff20849b5;p=sfa.git diff --git a/sfa/methods/get_key.py b/sfa/methods/get_key.py index 15175f4f..c641985b 100644 --- a/sfa/methods/get_key.py +++ b/sfa/methods/get_key.py @@ -4,11 +4,11 @@ import os import tempfile import commands from sfa.util.faults import * -from sfa.util.misc import * +from sfa.util.namespace import * from sfa.util.method import Method from sfa.util.parameter import Parameter, Mixed from sfa.trust.auth import Auth -from sfa.util.genitable import * +from sfa.util.table import SfaTable from sfa.trust.certificate import Keypair class get_key(Method): @@ -36,7 +36,7 @@ class get_key(Method): node = nodes[0] # look up the sfa record - table = GeniTable() + table = SfaTable() records = table.findObjects({'type': 'node', 'pointer': node['node_id']}) if not records: raise RecordNotFound("pointer:" + str(node['node_id'])) @@ -55,21 +55,21 @@ class get_key(Method): # attempt the scp the key # and gid onto the node - # this will only work for planetlab based compoenents + # this will only work for planetlab based components (kfd, key_filename) = tempfile.mkstemp() (gfd, gid_filename) = tempfile.mkstemp() pkey.save_to_file(key_filename) - gid_str = gid.save_to_file(save_parents=True) + gid_object.save_to_file(gid_filename, save_parents=True) host = node['hostname'] - key_dest="/etc/sfa/nodekey.key" - gid_dest="/etc/sfa/nodegid.gid" + key_dest="/etc/sfa/node.key" + gid_dest="/etc/sfa/node.gid" scp = "/usr/bin/scp" - identity = "/etc/planetlab/root_ssh_key.rsa" - scp_options=" -i %(identity)s %(filename)s " % locals() + identity = "/etc/sfa/root_ssh_key" + scp_options=" -i %(identity)s " % locals() scp_options+="-o StrictHostKeyChecking=no " % locals() - scp_key_command="%(scp)s %(scp_options)s root@%(host)s:%(key_dest)s" %\ + scp_key_command="%(scp)s %(scp_options)s %(key_filename)s root@%(host)s:%(key_dest)s" %\ locals() - scp_gid_command="%(scp)s %(scp_options)s root@%(host)s:%(gid_dest)s" %\ + scp_gid_command="%(scp)s %(scp_options)s %(gid_filename)s root@%(host)s:%(gid_dest)s" %\ locals() all_commands = [scp_key_command, scp_gid_command]