Bug 4284 - PolicyEnforcer could not find CI 77/26777/1
authorTomas Cechvala <tcechval@cisco.com>
Wed, 9 Sep 2015 12:21:59 +0000 (14:21 +0200)
committerTomas Cechvala <tcechval@cisco.com>
Thu, 10 Sep 2015 16:14:35 +0000 (16:14 +0000)
PolicyEnforcer could not find classifier-instance
name because it has been refering to a name of classifier-ref.

Change-Id: Iff08420d51059a79297b15f7938689123e1fb699
Signed-off-by: Tomas Cechvala <tcechval@cisco.com>
renderers/ofoverlay/src/main/java/org/opendaylight/groupbasedpolicy/renderer/ofoverlay/flow/PolicyEnforcer.java
renderers/ofoverlay/src/test/java/org/opendaylight/groupbasedpolicy/renderer/ofoverlay/flow/OfTableTest.java

index f444256fe5a92a8af123a0a9b325be000c85caf0..2d30d699d264213c2eb0b93b7689971c2fd612bc 100755 (executable)
@@ -323,10 +323,10 @@ public class PolicyEnforcer extends FlowTable {
             // extension and data plane support - in 2.4. Will need to handle
             // case where we are working with mix of nodes.
 
             // extension and data plane support - in 2.4. Will need to handle
             // case where we are working with mix of nodes.
 
-            ClassifierInstance ci = contractTenant.getClassifier(cr.getName());
+            ClassifierInstance ci = contractTenant.getClassifier(cr.getInstanceName());
             if (ci == null) {
                 // XXX TODO fail the match and raise an exception
             if (ci == null) {
                 // XXX TODO fail the match and raise an exception
-                LOG.warn("Classifier instance {} not found", cr.getName().getValue());
+                LOG.warn("Classifier instance {} not found", cr.getInstanceName().getValue());
                 return;
             }
             Classifier cfier = SubjectFeatures.getClassifier(ci.getClassifierDefinitionId());
                 return;
             }
             Classifier cfier = SubjectFeatures.getClassifier(ci.getClassifierDefinitionId());
index a786600979b314e82e393548892a1cdb605ee4c4..59cb4f7421cdba6aed8defa037c20f300d9804a9 100755 (executable)
@@ -223,6 +223,7 @@ public class OfTableTest {
                 .setClassifierRef(ImmutableList.of(new ClassifierRefBuilder()\r
                     .setName(new ClassifierName("tcp_dst_80"))\r
                     .setDirection(direction)\r
                 .setClassifierRef(ImmutableList.of(new ClassifierRefBuilder()\r
                     .setName(new ClassifierName("tcp_dst_80"))\r
                     .setDirection(direction)\r
+                    .setInstanceName(new ClassifierName("tcp_dst_80"))\r
                     .build()))\r
                 .build()));\r
     }\r
                     .build()))\r
                 .build()));\r
     }\r
@@ -237,6 +238,7 @@ public class OfTableTest {
         for (String refName : refNamesAndDirections.keySet()) {\r
             refs.add(new ClassifierRefBuilder().setName(new ClassifierName(refName))\r
                 .setDirection(refNamesAndDirections.get(refName))\r
         for (String refName : refNamesAndDirections.keySet()) {\r
             refs.add(new ClassifierRefBuilder().setName(new ClassifierName(refName))\r
                 .setDirection(refNamesAndDirections.get(refName))\r
+                .setInstanceName(new ClassifierName(refName))\r
                 .build());\r
         }\r
         return refs;\r
                 .build());\r
         }\r
         return refs;\r