summaryrefslogtreecommitdiffstats
path: root/framework/src/onos/protocols/ovsdb
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/onos/protocols/ovsdb')
-rw-r--r--framework/src/onos/protocols/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/driver/DefaultOvsdbClient.java21
-rw-r--r--framework/src/onos/protocols/ovsdb/pom.xml39
2 files changed, 19 insertions, 41 deletions
diff --git a/framework/src/onos/protocols/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/driver/DefaultOvsdbClient.java b/framework/src/onos/protocols/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/driver/DefaultOvsdbClient.java
index 8a661ab9..5f72606d 100644
--- a/framework/src/onos/protocols/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/driver/DefaultOvsdbClient.java
+++ b/framework/src/onos/protocols/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/driver/DefaultOvsdbClient.java
@@ -578,16 +578,7 @@ public class DefaultOvsdbClient
return false;
}
- String bridgeUuid = getBridgeUuid(bridgeName);
- if (bridgeUuid != null) {
- log.warn("Bridge {} is already exist", bridgeName);
- // remove existing one and re-create?
- return false;
- }
-
Bridge bridge = (Bridge) TableGenerator.createTable(dbSchema, OvsdbTable.BRIDGE);
- bridge.setName(bridgeName);
-
Set<String> failMode = new HashSet<>(Arrays.asList("secure"));
bridge.setFailMode(failMode);
@@ -598,9 +589,15 @@ public class DefaultOvsdbClient
options.put("datapath-id", dpid);
bridge.setOtherConfig(options);
- bridgeUuid = insertConfig(OvsdbConstant.BRIDGE, "_uuid",
- OvsdbConstant.DATABASENAME, "bridges",
- ovsUuid, bridge.getRow());
+ 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());
+ }
if (bridgeUuid != null) {
createPort(bridgeName, bridgeName);
diff --git a/framework/src/onos/protocols/ovsdb/pom.xml b/framework/src/onos/protocols/ovsdb/pom.xml
index 930978a4..03e9d98c 100644
--- a/framework/src/onos/protocols/ovsdb/pom.xml
+++ b/framework/src/onos/protocols/ovsdb/pom.xml
@@ -20,29 +20,24 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onosproject</groupId>
- <artifactId>onos</artifactId>
+ <artifactId>onos-protocols</artifactId>
<version>1.4.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
</parent>
+
<artifactId>onos-ovsdb</artifactId>
- <name>onos-ovsdb</name>
<packaging>pom</packaging>
<description>ONOS OVSDB southbound plugin</description>
+
+ <modules>
+ <module>api</module>
+ <module>rfc</module>
+ <module>ctl</module>
+ </modules>
+
<dependencies>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.onosproject</groupId>
- <artifactId>onlab-misc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.onosproject</groupId>
- <artifactId>onlab-junit</artifactId>
- </dependency>
- <dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
</dependency>
@@ -52,18 +47,4 @@
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
- <modules>
- <module>api</module>
- <module>rfc</module>
- <module>ctl</module>
- </modules>
</project> \ No newline at end of file