diff options
author | Miguel Peralvo <miguel.peralvo@gmail.com> | 2015-02-10 19:54:52 +0000 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2015-02-10 19:54:52 +0000 |
commit | c49a4049845c91b225e70fd630cdf6ddc055faf8 (patch) | |
tree | a094a8d227a98d567d82155a9bf9e4959b3088fb /ec2/spark_ec2.py | |
parent | 59272dad77eb95c5ae8e0652e00d02a2675cda53 (diff) | |
download | spark-c49a4049845c91b225e70fd630cdf6ddc055faf8.tar.gz spark-c49a4049845c91b225e70fd630cdf6ddc055faf8.tar.bz2 spark-c49a4049845c91b225e70fd630cdf6ddc055faf8.zip |
[SPARK-5668] Display region in spark_ec2.py get_existing_cluster()
Show the region for the different messages displayed by get_existing_cluster(): The search, found and error messages.
Author: Miguel Peralvo <miguel.peralvo@gmail.com>
Closes #4457 from MiguelPeralvo/patch-2 and squashes the following commits:
a5514c8 [Miguel Peralvo] Update spark_ec2.py
0a837b0 [Miguel Peralvo] Update spark_ec2.py
3923f36 [Miguel Peralvo] Update spark_ec2.py
4ecd9f9 [Miguel Peralvo] [SPARK-5668] Display region in spark_ec2.py get_existing_cluster()
Diffstat (limited to 'ec2/spark_ec2.py')
-rwxr-xr-x | ec2/spark_ec2.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ec2/spark_ec2.py b/ec2/spark_ec2.py index fe510f12bc..0ea7365d75 100755 --- a/ec2/spark_ec2.py +++ b/ec2/spark_ec2.py @@ -134,7 +134,7 @@ def parse_args(): help="Master instance type (leave empty for same as instance-type)") parser.add_option( "-r", "--region", default="us-east-1", - help="EC2 region zone to launch instances in") + help="EC2 region used to launch instances in, or to find them in") parser.add_option( "-z", "--zone", default="", help="Availability zone to launch instances in, or 'all' to spread " + @@ -614,7 +614,8 @@ def launch_cluster(conn, opts, cluster_name): # Get the EC2 instances in an existing cluster if available. # Returns a tuple of lists of EC2 instance objects for the masters and slaves def get_existing_cluster(conn, opts, cluster_name, die_on_error=True): - print "Searching for existing cluster " + cluster_name + "..." + print "Searching for existing cluster " + cluster_name + " in region " \ + + opts.region + "..." reservations = conn.get_all_reservations() master_nodes = [] slave_nodes = [] @@ -632,9 +633,11 @@ def get_existing_cluster(conn, opts, cluster_name, die_on_error=True): return (master_nodes, slave_nodes) else: if master_nodes == [] and slave_nodes != []: - print >> sys.stderr, "ERROR: Could not find master in group " + cluster_name + "-master" + print >> sys.stderr, "ERROR: Could not find master in group " + cluster_name \ + + "-master" + " in region " + opts.region else: - print >> sys.stderr, "ERROR: Could not find any existing cluster" + print >> sys.stderr, "ERROR: Could not find any existing cluster" \ + + " in region " + opts.region sys.exit(1) |