cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sw...@apache.org
Subject [1/7] git commit: updated refs/heads/4.8 to 142f07d
Date Tue, 28 Jun 2016 15:20:46 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.8 744f9d561 -> 142f07d77


Fixed ordering of network ACL rules being sent to the VR. The comparator was inverted


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/caf4a480
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/caf4a480
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/caf4a480

Branch: refs/heads/4.8
Commit: caf4a48075e0f59b5d101efdd3ac6b1bee8f4f39
Parents: 9275ba2
Author: Patrick Dube <pdube@cloudops.com>
Authored: Thu Jun 2 13:15:38 2016 -0400
Committer: Patrick Dube <pdube@cloudops.com>
Committed: Thu Jun 2 13:15:38 2016 -0400

----------------------------------------------------------------------
 .../agent/api/routing/SetNetworkACLCommand.java    | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/caf4a480/core/src/com/cloud/agent/api/routing/SetNetworkACLCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/routing/SetNetworkACLCommand.java b/core/src/com/cloud/agent/api/routing/SetNetworkACLCommand.java
index 59ef668..5aa4fca 100644
--- a/core/src/com/cloud/agent/api/routing/SetNetworkACLCommand.java
+++ b/core/src/com/cloud/agent/api/routing/SetNetworkACLCommand.java
@@ -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;
     }


Mime
View raw message