From 6b9e9fe05dbfb48862a3d999ea3e2ddd93f820aa Mon Sep 17 00:00:00 2001 From: Benno Joy Date: Fri, 5 Jun 2015 12:31:59 +0530 Subject: [PATCH] fix for 11177 where module readds rule even if the rules exists --- cloud/amazon/ec2_group.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cloud/amazon/ec2_group.py b/cloud/amazon/ec2_group.py index b85fde9ead3..2109c7ba33b 100644 --- a/cloud/amazon/ec2_group.py +++ b/cloud/amazon/ec2_group.py @@ -131,6 +131,11 @@ def make_rule_key(prefix, rule, group_id, cidr_ip): """Creates a unique key for an individual group rule""" if isinstance(rule, dict): 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 proto, from_port, to_port = [getattr(rule, x, None) for x in ('ip_protocol', 'from_port', 'to_port')]