We're getting back the correct group from get_security_group_from_id,
but hitting another issue with the source_group_name also using an id rather than a name
This commit is contained in:
parent
1480f8b44a
commit
cbdc8ba183
3 changed files with 31 additions and 6 deletions
|
|
@ -5,7 +5,15 @@ from moto.ec2.models import ec2_backend
|
|||
|
||||
|
||||
def process_rules_from_querystring(querystring):
|
||||
name = querystring.get('GroupName')[0]
|
||||
|
||||
name = None
|
||||
group_id = None
|
||||
|
||||
try:
|
||||
name = querystring.get('GroupName')[0]
|
||||
except:
|
||||
group_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]
|
||||
|
|
@ -18,7 +26,7 @@ def process_rules_from_querystring(querystring):
|
|||
for key, value in querystring.iteritems():
|
||||
if 'IpPermissions.1.Groups' in key:
|
||||
source_groups.append(value[0])
|
||||
return (name, ip_protocol, from_port, to_port, ip_ranges, source_groups)
|
||||
return (name, group_id, ip_protocol, from_port, to_port, ip_ranges, source_groups)
|
||||
|
||||
|
||||
class SecurityGroups(BaseResponse):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue