From e07894c6e4105300b273858e6f648ca6781a7393 Mon Sep 17 00:00:00 2001 From: Enis Afgan Date: Thu, 29 Oct 2015 07:27:35 +0100 Subject: [PATCH] When adding security group rules, allow a source group only to be specified - as per boto docs & functionality --- moto/ec2/responses/security_groups.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/moto/ec2/responses/security_groups.py b/moto/ec2/responses/security_groups.py index eec27c3aa..9a9aaafd9 100644 --- a/moto/ec2/responses/security_groups.py +++ b/moto/ec2/responses/security_groups.py @@ -9,9 +9,9 @@ def process_rules_from_querystring(querystring): except: group_name_or_id = querystring.get('GroupId')[0] - ip_protocol = querystring.get('IpPermissions.1.IpProtocol')[0] - from_port = querystring.get('IpPermissions.1.FromPort')[0] - to_port = querystring.get('IpPermissions.1.ToPort')[0] + ip_protocol = querystring.get('IpPermissions.1.IpProtocol', [None])[0] + from_port = querystring.get('IpPermissions.1.FromPort', [None])[0] + to_port = querystring.get('IpPermissions.1.ToPort', [None])[0] ip_ranges = [] for key, value in querystring.items(): if 'IpPermissions.1.IpRanges' in key: