CS-14728. ec2-revoke: Not able to revoke the icmp rules. Presented with "Server.InternalError:Cannot find matching ruleid"

Resolved. ICMP type and code was not correctly set in the request.
This commit is contained in:
Likitha Shetty 2012-05-14 13:20:13 +05:30
parent b2c38acb4e
commit c4f258fa82
2 changed files with 8 additions and 4 deletions

View File

@ -134,9 +134,13 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface {
for (IpPermissionType ipPerm : items) {
EC2IpPermission perm = new EC2IpPermission();
perm.setProtocol( ipPerm.getIpProtocol());
perm.setFromPort( ipPerm.getFromPort());
perm.setToPort( ipPerm.getToPort());
if (ipPerm.getIpProtocol().equalsIgnoreCase("icmp")) {
perm.setIcmpType( Integer.toString(ipPerm.getFromPort()));
perm.setIcmpCode( Integer.toString(ipPerm.getToPort()));
} else {
perm.setFromPort( ipPerm.getFromPort());
perm.setToPort( ipPerm.getToPort());
}
UserIdGroupPairSetType groups = ipPerm.getGroups();
if (null != groups && groups.getItem() != null) {
UserIdGroupPairType[] groupItems = groups.getItem();

View File

@ -331,7 +331,7 @@ public class EC2Engine {
CloudStackSecurityGroupIngress resp = null;
if (ipPerm.getProtocol().equalsIgnoreCase("icmp")) {
resp = getApi().authorizeSecurityGroupIngress(null, constructList(ipPerm.getIpRangeSet()), null, null,
ipPerm.getToPort().toString(), ipPerm.getFromPort().toString(), ipPerm.getProtocol(), null,
ipPerm.getIcmpCode(), ipPerm.getIcmpType(), ipPerm.getProtocol(), null,
request.getName(), null, secGroupList);
} else {
resp = getApi().authorizeSecurityGroupIngress(null, constructList(ipPerm.getIpRangeSet()), null,