Bug 6506: Add bridge stp_enble to ovsdb.yang
[ovsdb.git] / southbound / southbound-impl / src / main / java / org / opendaylight / ovsdb / southbound / transactions / md / OvsdbBridgeUpdateCommand.java
index 01abf5cd325e336da71a635e3896eee120c7132f..346d443165962da91e0509a30cd0185b4f16ee41 100644 (file)
@@ -229,6 +229,7 @@ public class OvsdbBridgeUpdateCommand extends AbstractTransactionCommand {
         setOpenFlowNodeRef(ovsdbBridgeAugmentationBuilder, bridge);
         setManagedBy(ovsdbBridgeAugmentationBuilder);
         setAutoAttach(ovsdbBridgeAugmentationBuilder, bridge);
+        setStpEnalbe(ovsdbBridgeAugmentationBuilder,bridge);
         bridgeNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, ovsdbBridgeAugmentationBuilder.build());
 
         LOG.debug("Built with the intent to store bridge data {}",
@@ -333,6 +334,16 @@ public class OvsdbBridgeUpdateCommand extends AbstractTransactionCommand {
         }
     }
 
+    private void setStpEnalbe(OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder,
+                              Bridge bridge) {
+        if (bridge.getStpEnableColumn() != null) {
+            Boolean stpEnable = bridge.getStpEnableColumn().getData();
+            if (stpEnable != null) {
+                ovsdbBridgeAugmentationBuilder.setStpEnable(stpEnable);
+            }
+        }
+    }
+
     private void setOpenFlowNodeRef(OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder,
             Bridge bridge) {
         Map<UUID, Controller> updatedControllerRows =