Skip to content

Commit

Permalink
cluster: add get_cluster_group_or_none
Browse files Browse the repository at this point in the history
This should have been included in commit fddbe7f

Returns only the cluster's EC2 security group if it exists, None if not.
  • Loading branch information
jtriley committed Dec 13, 2012
1 parent e766fc5 commit ced52d9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions starcluster/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ def get_cluster_security_group(self, group_name):
gname = self._get_cluster_name(group_name)
return self.ec2.get_security_group(gname)

def get_cluster_group_or_none(self, group_name):
try:
return self.get_cluster_security_group(group_name)
except exception.SecurityGroupDoesNotExist:
pass

def get_cluster_security_groups(self):
"""
Return all security groups on EC2 that start with '@sc-'
Expand Down

0 comments on commit ced52d9

Please sign in to comment.