mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #29645 from rallytime/bp-29558
Back-port #29558 to 2015.8
This commit is contained in:
commit
ef2c9e3f61
@ -174,6 +174,11 @@ def _get_group(conn=None, name=None, vpc_id=None, vpc_name=None, group_id=None,
|
||||
# a group in EC2-Classic will have vpc_id set to None
|
||||
if group.vpc_id is None:
|
||||
return group
|
||||
# If there are more security groups, and no vpc_id, we can't know which one to choose.
|
||||
if len(filtered_groups) > 1:
|
||||
raise Exception('Security group belongs to more VPCs, specify the VPC ID!')
|
||||
elif len(filtered_groups) == 1:
|
||||
return filtered_groups[0]
|
||||
return None
|
||||
elif vpc_id:
|
||||
log.debug('getting group for {0} in vpc_id {1}'.format(name, vpc_id))
|
||||
|
Loading…
Reference in New Issue
Block a user