OVSDB project's OpenFlow 1.3 ProtocolPlugin integration via Controller's MD-SAL infra...
[ovsdb.git] / neutron / src / main / java / org / opendaylight / ovsdb / neutron / InternalNetworkManager.java
index aced03c4b3563cfd11eb96157131b9f9297a6f93..b11ada9353fb2b8fafa3c249b9bce947d2a6edab 100644 (file)
@@ -112,8 +112,10 @@ public class InternalNetworkManager {
 
         Status status = this.addInternalBridge(node, brInt, patchTun, patchInt);
         if (!status.isSuccess()) logger.debug("Integration Bridge Creation Status : "+status.toString());
-        status = this.addInternalBridge(node, brTun, patchInt, patchTun);
-        if (!status.isSuccess()) logger.debug("Tunnel Bridge Creation Status : "+status.toString());
+        if (ProviderNetworkManager.getManager().hasPerTenantTunneling()) {
+            status = this.addInternalBridge(node, brTun, patchInt, patchTun);
+            if (!status.isSuccess()) logger.debug("Tunnel Bridge Creation Status : "+status.toString());
+        }
     }
 
     /*
@@ -138,6 +140,11 @@ public class InternalNetworkManager {
         if (bridgeUUID == null) {
             Bridge bridge = new Bridge();
             bridge.setName(bridgeName);
+            if (!ProviderNetworkManager.getManager().hasPerTenantTunneling()) {
+                OvsDBSet<String> protocols = new OvsDBSet<String>();
+                protocols.add("OpenFlow13");
+                bridge.setProtocols(protocols);
+            }
 
             StatusWithUuid statusWithUuid = ovsdbTable.insertRow(node, Bridge.NAME.getName(), null, bridge);
             if (!statusWithUuid.isSuccess()) return statusWithUuid;
@@ -150,7 +157,7 @@ public class InternalNetworkManager {
         IConnectionServiceInternal connectionService = (IConnectionServiceInternal)ServiceHelper.getGlobalInstance(IConnectionServiceInternal.class, this);
         connectionService.setOFController(node, bridgeUUID);
 
-        if (localPathName != null && remotePatchName != null) {
+        if (localPathName != null && remotePatchName != null && ProviderNetworkManager.getManager().hasPerTenantTunneling()) {
             return addPatchPort(node, bridgeUUID, localPathName, remotePatchName);
         }
         return new Status(StatusCode.SUCCESS);