Fixes #816 unable to set security group ingress with AWSEC2Client

This commit is contained in:
vijaykiran 2012-07-05 00:22:20 +02:00
parent bc94e367ce
commit 769ace1640
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]}");
}
}