fix for 11177 where module readds rule even if the rules exists
This commit is contained in:
parent
29115f0602
commit
f6f2359400
1 changed files with 5 additions and 0 deletions
|
@ -127,6 +127,11 @@ def make_rule_key(prefix, rule, group_id, cidr_ip):
|
||||||
"""Creates a unique key for an individual group rule"""
|
"""Creates a unique key for an individual group rule"""
|
||||||
if isinstance(rule, dict):
|
if isinstance(rule, dict):
|
||||||
proto, from_port, to_port = [rule.get(x, None) for x in ('proto', 'from_port', 'to_port')]
|
proto, from_port, to_port = [rule.get(x, None) for x in ('proto', 'from_port', 'to_port')]
|
||||||
|
#fix for 11177
|
||||||
|
if proto not in ['icmp', 'tcp', 'udp'] and from_port == -1 and to_port == -1:
|
||||||
|
from_port = 'none'
|
||||||
|
to_port = 'none'
|
||||||
|
|
||||||
else: # isinstance boto.ec2.securitygroup.IPPermissions
|
else: # isinstance boto.ec2.securitygroup.IPPermissions
|
||||||
proto, from_port, to_port = [getattr(rule, x, None) for x in ('ip_protocol', 'from_port', 'to_port')]
|
proto, from_port, to_port = [getattr(rule, x, None) for x in ('ip_protocol', 'from_port', 'to_port')]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue