Esempio n. 1
0
 def run(self, command, directory="/mnt"):
     conn = ec2.connect_to_region(self.region)
     master_nodes, slave_nodes = get_existing_cluster(conn, self.opts, self.cluster_name, die_on_error=False)
     master_host = master_nodes[0].public_dns_name
     if directory:
         command = ["cd {0};".format(directory)] + command
     subprocess.check_call(ssh_command(self.opts) + ["-A", "{0}@{1}".format(self.opts.user, master_host)] + command)
Esempio n. 2
0
 def copy(self, filename, directory="/mnt"):
     conn = ec2.connect_to_region(self.region)
     master_nodes, slave_nodes = get_existing_cluster(conn, self.opts, self.cluster_name, die_on_error=False)
     master_host = master_nodes[0].public_dns_name
     command = [
         "rsync", "-rv",
         "-e", stringify_command(ssh_command(self.opts)),
         filename,
         "{0}@{1}:{2}/".format(self.opts.user, master_host, directory)
     ]
     subprocess.check_call(command)
Esempio n. 3
0
 def run(self, command, directory="/mnt"):
     conn = ec2.connect_to_region(self.region)
     master_nodes, slave_nodes = get_existing_cluster(conn,
                                                      self.opts,
                                                      self.cluster_name,
                                                      die_on_error=False)
     master_host = master_nodes[0].public_dns_name
     if directory:
         command = ["cd {0};".format(directory)] + command
     subprocess.check_call(
         ssh_command(self.opts) +
         ["-A", "{0}@{1}".format(self.opts.user, master_host)] + command)
Esempio n. 4
0
 def copy(self, filename, directory="/mnt"):
     conn = ec2.connect_to_region(self.region)
     master_nodes, slave_nodes = get_existing_cluster(conn,
                                                      self.opts,
                                                      self.cluster_name,
                                                      die_on_error=False)
     master_host = master_nodes[0].public_dns_name
     command = [
         "rsync", "-rv", "-e",
         stringify_command(ssh_command(self.opts)), filename,
         "{0}@{1}:{2}/".format(self.opts.user, master_host, directory)
     ]
     subprocess.check_call(command)