Changeset 0b799e0 for fedd


Ignore:
Timestamp:
Mar 7, 2010 8:39:41 AM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
c2c153b
Parents:
062b991
Message:

stage an ssh identity properly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/proxy_protogeni_segment.py

    r062b991 r0b799e0  
    329329
    330330        fed_dir = "/usr/local/federation"
    331         ssh = "/usr/bin/ssh -n -o 'ForwardX11 no' -o 'StrictHostKeyChecking no' "
    332         scp = "/usr/bin/scp -o 'ForwardX11 no' -o 'StrictHostKeyChecking no' "
     331        ssh = "/usr/bin/ssh -n -i .ssh/id_rsa -o 'ForwardX11 no' -o 'StrictHostKeyChecking no' "
     332        scp = "/usr/bin/scp -i .ssh/id_rsa -o 'ForwardX11 no' -o 'StrictHostKeyChecking no' "
    333333        ifconfig = "/sbin/ifconfig"
    334334        tar = "/bin/tar"
     
    403403                self.log.error("Unmapped node: %s" % vname)
    404404
    405     def start_nodes(self, user, nodes):
     405    def start_node(self, user, host, node):
     406        # Place an identity on the node so that the copying can succeed
     407        self.ssh_cmd(user, host, "scp .ssh/id_rsa %s:.ssh" % node)
     408        self.ssh_cmd(user, node, "sudo /bin/sh ./%s.startup &" % node)
     409
     410    def start_nodes(self, user, host, nodes):
    406411        threads = [ ]
    407412        for n in nodes:
    408             t = Thread(target=self.ssh_cmd, args=(user, n,
    409                     "sudo /bin/sh ./%s.startup &" % n))
     413            t = Thread(target=self.start_node, args=(user, host, n))
    410414            t.start()
    411415            threads.append(t)
     
    610614                pubkey, secretkey, stagingdir, tmpdir)
    611615
    612         self.start_nodes(user, [ n['hostname'] for n in nodes.values()])
     616        self.start_nodes(user, parent.staging_host,
     617                [ n['hostname'] for n in nodes.values()])
    613618
    614619        # Everything has gone OK.
Note: See TracChangeset for help on using the changeset viewer.