Hyunsun Moon
Committed by Gerrit Code Review

Reverted create bridge

Reverged https://gerrit.onosproject.org/#/c/6585/ due to
multiple same controllers are set.

Change-Id: I2628fccc968adfec619a61b85b7932864a837a37
......@@ -578,6 +578,11 @@ public class DefaultOvsdbClient
return false;
}
String bridgeUuid = getBridgeUuid(bridgeName);
if (bridgeUuid != null) {
return false;
}
Bridge bridge = (Bridge) TableGenerator.createTable(dbSchema, OvsdbTable.BRIDGE);
Set<String> failMode = new HashSet<>(Arrays.asList("secure"));
bridge.setFailMode(failMode);
......@@ -589,15 +594,10 @@ public class DefaultOvsdbClient
options.put("datapath-id", dpid);
bridge.setOtherConfig(options);
String bridgeUuid = getBridgeUuid(bridgeName);
if (bridgeUuid == null) {
bridge.setName(bridgeName);
bridgeUuid = insertConfig(OvsdbConstant.BRIDGE, "_uuid",
OvsdbConstant.DATABASENAME, "bridges",
ovsUuid, bridge.getRow());
} else {
updateConfig(OvsdbConstant.BRIDGE, "_uuid", bridgeUuid, bridge.getRow());
}
bridge.setName(bridgeName);
bridgeUuid = insertConfig(OvsdbConstant.BRIDGE, "_uuid",
OvsdbConstant.DATABASENAME, "bridges",
ovsUuid, bridge.getRow());
if (bridgeUuid != null) {
createPort(bridgeName, bridgeName);
......