Bug 6085 - Modifying config flow does not work if first flow creation failed 44/40744/1
authorAnil Vishnoi <vishnoianil@gmail.com>
Sat, 18 Jun 2016 08:26:55 +0000 (01:26 -0700)
committerShuva Jyoti Kar <shuva.jyoti.kar@ericsson.com>
Thu, 23 Jun 2016 02:28:12 +0000 (02:28 +0000)
Change-Id: I1f8176daffb97f0b3a4eb1ffc018f625f3afd65b
Signed-off-by: Anil Vishnoi <vishnoianil@gmail.com>
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/FlowConvertor.java
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/FlowConvertorTest.java

index fe0ccc1851728d9232e9288ff08ba57ebf2a5ede..0115b55560799d0c88de9a74b5f6dd42bb3b8ed4 100644 (file)
@@ -261,7 +261,7 @@ public class FlowConvertor {
     }
 
     private static void salToOFFlowCommand(Flow flow, FlowModInputBuilder flowMod) {
-        if (flow instanceof AddFlowInput) {
+        if (flow instanceof AddFlowInput || flow instanceof UpdatedFlow) {
             flowMod.setCommand(FlowModCommand.OFPFCADD);
         } else if (flow instanceof RemoveFlowInput) {
             if (MoreObjects.firstNonNull(flow.isStrict(), Boolean.FALSE)) {
@@ -269,12 +269,6 @@ public class FlowConvertor {
             } else {
                 flowMod.setCommand(FlowModCommand.OFPFCDELETE);
             }
-        } else if (flow instanceof UpdatedFlow) {
-            if (MoreObjects.firstNonNull(flow.isStrict(), Boolean.FALSE)) {
-                flowMod.setCommand(FlowModCommand.OFPFCMODIFYSTRICT);
-            } else {
-                flowMod.setCommand(FlowModCommand.OFPFCMODIFY);
-            }
         }
     }
 
index 6779145b00ffc9d45bdcf98c6be37d60b6b50023..210f9f255c06b7ee7d69760d43f6f6a7e31c73cb 100644 (file)
@@ -108,7 +108,7 @@ public class FlowConvertorTest {
                 .toFlowModInputs(flow, EncodeConstants.OF10_VERSION_ID, new BigInteger("42"));\r
 \r
         Assert.assertEquals("Wrong version", 1, flowMod.get(0).getVersion().intValue());\r
-        Assert.assertEquals("Wrong command", FlowModCommand.OFPFCMODIFYSTRICT, flowMod.get(0).getCommand());\r
+        Assert.assertEquals("Wrong command", FlowModCommand.OFPFCADD, flowMod.get(0).getCommand());\r
     }\r
 \r
     /**\r