mirror of https://github.com/apache/cloudstack.git
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:
parent
b2c38acb4e
commit
c4f258fa82
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue