Fix for security groups with other security source groups. Closes #80.
This commit is contained in:
parent
55363b0895
commit
262b698149
1 changed files with 6 additions and 2 deletions
|
|
@ -357,7 +357,9 @@ class SecurityGroupBackend(object):
|
||||||
group = self.get_security_group_from_name(group_name, vpc_id)
|
group = self.get_security_group_from_name(group_name, vpc_id)
|
||||||
source_groups = []
|
source_groups = []
|
||||||
for source_group_name in source_group_names:
|
for source_group_name in source_group_names:
|
||||||
source_groups.append(self.get_security_group_from_name(source_group_name, vpc_id))
|
source_group = self.get_security_group_from_name(source_group_name, vpc_id)
|
||||||
|
if source_group:
|
||||||
|
source_groups.append(source_group)
|
||||||
|
|
||||||
security_rule = SecurityRule(ip_protocol, from_port, to_port, ip_ranges, source_groups)
|
security_rule = SecurityRule(ip_protocol, from_port, to_port, ip_ranges, source_groups)
|
||||||
group.ingress_rules.append(security_rule)
|
group.ingress_rules.append(security_rule)
|
||||||
|
|
@ -366,7 +368,9 @@ class SecurityGroupBackend(object):
|
||||||
group = self.get_security_group_from_name(group_name, vpc_id)
|
group = self.get_security_group_from_name(group_name, vpc_id)
|
||||||
source_groups = []
|
source_groups = []
|
||||||
for source_group_name in source_group_names:
|
for source_group_name in source_group_names:
|
||||||
source_groups.append(self.get_security_group_from_name(source_group_name, vpc_id))
|
source_group = self.get_security_group_from_name(source_group_name, vpc_id)
|
||||||
|
if source_group:
|
||||||
|
source_groups.append(source_group)
|
||||||
|
|
||||||
security_rule = SecurityRule(ip_protocol, from_port, to_port, ip_ranges, source_groups)
|
security_rule = SecurityRule(ip_protocol, from_port, to_port, ip_ranges, source_groups)
|
||||||
if security_rule in group.ingress_rules:
|
if security_rule in group.ingress_rules:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue