From: Anil Vishnoi Date: Sat, 18 Jun 2016 08:26:55 +0000 (-0700) Subject: Bug 6085 - Modifying config flow does not work if first flow creation failed X-Git-Tag: release/boron~143^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=a9e5419dba6e5206ee9f640faa5cf034a26e4767;p=openflowplugin.git Bug 6085 - Modifying config flow does not work if first flow creation failed Change-Id: I1f8176daffb97f0b3a4eb1ffc018f625f3afd65b Signed-off-by: Anil Vishnoi --- diff --git a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/FlowConvertor.java b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/FlowConvertor.java index fe0ccc1851..0115b55560 100644 --- a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/FlowConvertor.java +++ b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/FlowConvertor.java @@ -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); - } } } diff --git a/openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/FlowConvertorTest.java b/openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/FlowConvertorTest.java index 6779145b00..210f9f255c 100644 --- a/openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/FlowConvertorTest.java +++ b/openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/FlowConvertorTest.java @@ -108,7 +108,7 @@ public class FlowConvertorTest { .toFlowModInputs(flow, EncodeConstants.OF10_VERSION_ID, new BigInteger("42")); Assert.assertEquals("Wrong version", 1, flowMod.get(0).getVersion().intValue()); - Assert.assertEquals("Wrong command", FlowModCommand.OFPFCMODIFYSTRICT, flowMod.get(0).getCommand()); + Assert.assertEquals("Wrong command", FlowModCommand.OFPFCADD, flowMod.get(0).getCommand()); } /**