6 class node_remote_call(Test):
8 Attempt to connect to a node using the plc root key and
12 def call(self, hostname, command, root_key_path = "/etc/planetlab/root_ssh_key.rsa"):
13 if not os.path.isfile(root_key_path):
14 raise Exception, "no such private key file %(root_key_path)s" % locals()
16 full_command = "ssh -i %(root_key_path)s root@%(hostname)s %(command)s" % locals()
17 if self.config.verbose:
18 utils.header(full_command)
19 (stdout, stderr) = utils.popen(full_command)
21 if self.config.verbose:
22 utils.header("\n".join(stdout))
27 if __name__ == '__main__':
28 args = tuple(sys.argv[1:])
29 plc_remote_call()(*args)