mirror of https://github.com/apache/cloudstack.git
Fixed ordering of network ACL rules being sent to the VR. The comparator was inverted
This commit is contained in:
parent
9275ba27f3
commit
caf4a48075
|
|
@ -45,12 +45,8 @@ public class SetNetworkACLCommand extends NetworkElementCommand {
|
|||
|
||||
public String[][] generateFwRules() {
|
||||
final List<NetworkACLTO> aclList = Arrays.asList(rules);
|
||||
Collections.sort(aclList, new Comparator<NetworkACLTO>() {
|
||||
@Override
|
||||
public int compare(final NetworkACLTO acl1, final NetworkACLTO acl2) {
|
||||
return acl1.getNumber() < acl2.getNumber() ? 1 : -1;
|
||||
}
|
||||
});
|
||||
|
||||
orderNetworkAclRulesByRuleNumber(aclList);
|
||||
|
||||
final String[][] result = new String[2][aclList.size()];
|
||||
int i = 0;
|
||||
|
|
@ -97,6 +93,15 @@ public class SetNetworkACLCommand extends NetworkElementCommand {
|
|||
return result;
|
||||
}
|
||||
|
||||
protected void orderNetworkAclRulesByRuleNumber(List<NetworkACLTO> aclList) {
|
||||
Collections.sort(aclList, new Comparator<NetworkACLTO>() {
|
||||
@Override
|
||||
public int compare(final NetworkACLTO acl1, final NetworkACLTO acl2) {
|
||||
return acl1.getNumber() > acl2.getNumber() ? 1 : -1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public NicTO getNic() {
|
||||
return nic;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue