Skip to content

Commit

Permalink
Revert "handling exceptions about adding tags to ec2"
Browse files Browse the repository at this point in the history
This reverts commit 6adcf6d.
  • Loading branch information
GenTang committed Jan 31, 2015
1 parent 6a8b53b commit 3179737
Showing 1 changed file with 7 additions and 20 deletions.
27 changes: 7 additions & 20 deletions ec2/spark_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,28 +569,15 @@ def launch_cluster(conn, opts, cluster_name):
master_nodes = master_res.instances
print "Launched master in %s, regid = %s" % (zone, master_res.id)

# Give the instances descriptive names.
# The code of handling exceptions corresponds to issue [SPARK-4983]
# Give the instances descriptive names
for master in master_nodes:
while True:
try:
master.add_tag(
key='Name',
value='{cn}-master-{iid}'.format(cn=cluster_name, iid=master.id))
except:
pass
else:
break
master.add_tag(
key='Name',
value='{cn}-master-{iid}'.format(cn=cluster_name, iid=master.id))
for slave in slave_nodes:
while True:
try:
slave.add_tag(
key='Name',
value='{cn}-slave-{iid}'.format(cn=cluster_name, iid=slave.id))
except:
pass
else:
break
slave.add_tag(
key='Name',
value='{cn}-slave-{iid}'.format(cn=cluster_name, iid=slave.id))

# Return all the instances
return (master_nodes, slave_nodes)
Expand Down

0 comments on commit 3179737

Please sign in to comment.