aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Wendell <pwendell@gmail.com>2013-09-19 14:21:24 -0700
committerPatrick Wendell <pwendell@gmail.com>2013-09-19 14:21:24 -0700
commitcd7222c3dd2211ce790fa52110db911b862bb63b (patch)
tree683793146c5449f65b8d3efd9b2b6704df3c4960
parent2aff7989ab617f33052098498119886c40794774 (diff)
parentf589ce771a53dcbfda5f62fe0ac77164688ecc76 (diff)
downloadspark-cd7222c3dd2211ce790fa52110db911b862bb63b.tar.gz
spark-cd7222c3dd2211ce790fa52110db911b862bb63b.tar.bz2
spark-cd7222c3dd2211ce790fa52110db911b862bb63b.zip
Merge pull request #938 from ilikerps/master
Fix issue with spark_ec2 seeing empty security groups
-rwxr-xr-xec2/spark_ec2.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ec2/spark_ec2.py b/ec2/spark_ec2.py
index 419d0fe13f..6b7d202a88 100755
--- a/ec2/spark_ec2.py
+++ b/ec2/spark_ec2.py
@@ -364,12 +364,12 @@ def get_existing_cluster(conn, opts, cluster_name, die_on_error=True):
slave_nodes = []
for res in reservations:
active = [i for i in res.instances if is_active(i)]
- if len(active) > 0:
- group_names = [g.name for g in res.groups]
+ for inst in active:
+ group_names = [g.name for g in inst.groups]
if group_names == [cluster_name + "-master"]:
- master_nodes += res.instances
+ master_nodes.append(inst)
elif group_names == [cluster_name + "-slaves"]:
- slave_nodes += res.instances
+ slave_nodes.append(inst)
if any((master_nodes, slave_nodes)):
print ("Found %d master(s), %d slaves" %
(len(master_nodes), len(slave_nodes)))