Merge pull request #697 from vijaykiran/issue-816

Fixes #816 unable to set security group ingress with AWSEC2Client
This commit is contained in:
Adrian Cole 2012-07-04 15:27:31 -07:00
commit f95070a88e
2 changed files with 3 additions and 2 deletions

View File

@ -73,8 +73,9 @@ public class IpPermissions extends IpPermissionImpl {
i = 0;
for (Entry<String, String> userIdGroupNamePair : checkNotNull(permission.getUserIdGroupPairs(),
"userIdGroupNamePairs").entries()) {
headers.put(prefix + i++ + ".UserId", userIdGroupNamePair.getKey());
headers.put(prefix + i + ".UserId", userIdGroupNamePair.getKey());
headers.put(prefix + i + ".GroupName", userIdGroupNamePair.getValue());
i++;
}
prefix = "IpPermissions.%d.IpRanges.";
i = 0;

View File

@ -103,6 +103,6 @@ public class IpPermissionsTest {
"groupId");
assertEquals(
IpPermissions.buildFormParametersForIndex(0, authorization).toString(),
"{IpPermissions.0.IpProtocol=[icmp], IpPermissions.0.FromPort=[-1], IpPermissions.0.ToPort=[-1], IpPermissions.0.Groups.0.UserId=[userId], IpPermissions.0.Groups.1.GroupName=[groupId]}");
"{IpPermissions.0.IpProtocol=[icmp], IpPermissions.0.FromPort=[-1], IpPermissions.0.ToPort=[-1], IpPermissions.0.Groups.0.UserId=[userId], IpPermissions.0.Groups.0.GroupName=[groupId]}");
}
}