Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-4745] Fix get_existing_cluster() function with multiple security groups #3596

Closed
wants to merge 1 commit into from

Conversation

alexdebrie
Copy link
Contributor

The current get_existing_cluster() function would only find an instance belonged to a cluster if the instance's security groups == cluster_name + "-master" (or "-slaves"). This fix allows for multiple security groups by checking if the cluster_name + "-master" security group is in the list of groups for a particular instance.

The current get_existing_cluster() function would only find an instance belonged to a cluster if the instance's security groups == [cluster_name + "-master"] (or "-slaves"). This fix allows for multiple security groups by checking if the cluster_name + "-master" security group is in the list of groups for a particular instance.
@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@alexdebrie alexdebrie changed the title Fix get_existing_cluster() function with multiple security groups [SPARK-4745] Fix get_existing_cluster() function with multiple security groups Dec 4, 2014
@JoshRosen
Copy link
Contributor

LGTM. I tested this out myself and it works, so I'm going to merge this into master, branch-1.2 and branch-1.1.

@@ -504,9 +504,9 @@ def get_existing_cluster(conn, opts, cluster_name, die_on_error=True):
active = [i for i in res.instances if is_active(i)]
for inst in active:
group_names = [g.name for g in inst.groups]
if group_names == [cluster_name + "-master"]:
if cluster_name + "-master" in group_names:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit, but I think it's clearer to add parentheses here to make the operator precedence more clear. I'm going to do this myself while merging.

asfgit pushed a commit that referenced this pull request Dec 4, 2014
…ty groups

The current get_existing_cluster() function would only find an instance belonged to a cluster if the instance's security groups == cluster_name + "-master" (or "-slaves"). This fix allows for multiple security groups by checking if the cluster_name + "-master" security group is in the list of groups for a particular instance.

Author: alexdebrie <alexdebrie1@gmail.com>

Closes #3596 from alexdebrie/master and squashes the following commits:

9d51232 [alexdebrie] Fix get_existing_cluster() function with multiple security groups

(cherry picked from commit 794f3ae)
Signed-off-by: Josh Rosen <joshrosen@databricks.com>
@asfgit asfgit closed this in 794f3ae Dec 4, 2014
asfgit pushed a commit that referenced this pull request Dec 4, 2014
…ty groups

The current get_existing_cluster() function would only find an instance belonged to a cluster if the instance's security groups == cluster_name + "-master" (or "-slaves"). This fix allows for multiple security groups by checking if the cluster_name + "-master" security group is in the list of groups for a particular instance.

Author: alexdebrie <alexdebrie1@gmail.com>

Closes #3596 from alexdebrie/master and squashes the following commits:

9d51232 [alexdebrie] Fix get_existing_cluster() function with multiple security groups

(cherry picked from commit 794f3ae)
Signed-off-by: Josh Rosen <joshrosen@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants