Skip to content
Snippets Groups Projects
Commit 2197b215 authored by Patrick Wendell's avatar Patrick Wendell
Browse files

Removing unnecessary parsing

parent 36c117a1
No related branches found
No related tags found
No related merge requests found
...@@ -192,9 +192,7 @@ def get_spark_ami(opts): ...@@ -192,9 +192,7 @@ def get_spark_ami(opts):
# TODO(pwendell) Once we have multiple Spark AMI versions, we should let # TODO(pwendell) Once we have multiple Spark AMI versions, we should let
# people give a version flag here in place of just saying 'latest'. # people give a version flag here in place of just saying 'latest'.
version = version[1:] version = version[1:]
parts = opts.region.split("-") ami_path = "%s/%s/%s/%s" % (AMI_PREFIX, version, opts.region, instance_type)
region = "-".join([parts[0], parts[1], parts[2][0]]) # strip any avail. zone
ami_path = "%s/%s/%s/%s" % (AMI_PREFIX, version, region, instance_type)
try: try:
ami = urllib2.urlopen(ami_path).read().strip() ami = urllib2.urlopen(ami_path).read().strip()
print "Spark AMI: " + ami print "Spark AMI: " + ami
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment