aboutsummaryrefslogtreecommitdiff
path: root/ec2/spark_ec2.py
diff options
context:
space:
mode:
authorPatrick Wendell <pwendell@gmail.com>2013-05-18 16:00:32 -0700
committerPatrick Wendell <pwendell@gmail.com>2013-05-18 16:00:32 -0700
commita07bd286bb899e99f5992b163a74497047fce448 (patch)
tree3662d2ab54c91a8c0d6735827fc416c3dffeb575 /ec2/spark_ec2.py
parente8a1d029564c8f050a1b727ca23ae4829a9e0ed3 (diff)
downloadspark-a07bd286bb899e99f5992b163a74497047fce448.tar.gz
spark-a07bd286bb899e99f5992b163a74497047fce448.tar.bz2
spark-a07bd286bb899e99f5992b163a74497047fce448.zip
Some changes in response to Josh
Diffstat (limited to 'ec2/spark_ec2.py')
-rwxr-xr-xec2/spark_ec2.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/ec2/spark_ec2.py b/ec2/spark_ec2.py
index d05b767cb8..7df7ae2ae4 100755
--- a/ec2/spark_ec2.py
+++ b/ec2/spark_ec2.py
@@ -186,12 +186,11 @@ def get_spark_ami(opts):
instance_type = "pvm"
print >> stderr,\
"Don't recognize %s, assuming type is pvm" % opts.instance_type
- if version not in ["latest", "v0.7.0"]:
+
+ version = version.replace("v", "")
+ if version not in ["latest", "0.7.0"]:
print >> stderr, \
"Don't know how to resolve AMI for version: %s" % version
- # TODO(pwendell) Once we have multiple Spark AMI versions, we should let
- # people give a version flag here in place of just saying 'latest'.
- version = version[1:]
ami_path = "%s/%s/%s/%s" % (AMI_PREFIX, version, opts.region, instance_type)
try:
ami = urllib2.urlopen(ami_path).read().strip()
@@ -253,7 +252,7 @@ def launch_cluster(conn, opts, cluster_name):
sys.exit(1)
# Figure out Spark AMI
- if opts.ami[0] == "v":
+ if "ami" not in opts.ami:
opts.ami = get_spark_ami(opts)
print "Launching instances..."