BUG 5366: SB and hwvtep exceptions when both inuse 88/34988/1
authorVishal Thapar <vishal.thapar@ericsson.com>
Thu, 18 Feb 2016 15:11:36 +0000 (20:41 +0530)
committerSam Hague <shague@redhat.com>
Fri, 19 Feb 2016 01:53:26 +0000 (01:53 +0000)
When hwvtep and ovsdbSB both are enabled their respective
connectionManagers don't check if relevant DB is present or not.

Change-Id: I213ff3495d13a2bb2377ae3146290599280d4489
Signed-off-by: Vishal Thapar <vishal.thapar@ericsson.com>
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepConnectionManager.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionManager.java

index 85a83662da53b60f8c6b474945f2474a588d7f53..f62411ca535e44d870fd995ff92c9d6b60daccc4 100644 (file)
@@ -96,8 +96,10 @@ public class HwvtepConnectionManager implements OvsdbConnectionListener, AutoClo
                 client.getConnectionInfo().getRemotePort(),
                 client.getConnectionInfo().getLocalAddress(),
                 client.getConnectionInfo().getLocalPort());
-        HwvtepConnectionInstance hwClient = connectedButCallBacksNotRegistered(client);
-        registerEntityForOwnership(hwClient);
+        if(client.getSchema(HwvtepSchemaConstants.HARDWARE_VTEP) != null) {
+            HwvtepConnectionInstance hwClient = connectedButCallBacksNotRegistered(client);
+            registerEntityForOwnership(hwClient);
+        }
     }
 
     @Override
index baf064ed1b8021e8f08f2df9372abbafe35166b3..5c9c121b6e6871e1868be9af24be1e22529ae3f9 100644 (file)
@@ -94,10 +94,11 @@ public class OvsdbConnectionManager implements OvsdbConnectionListener, AutoClos
                 externalClient.getConnectionInfo().getRemotePort(),
                 externalClient.getConnectionInfo().getLocalAddress(),
                 externalClient.getConnectionInfo().getLocalPort());
-        OvsdbConnectionInstance client = connectedButCallBacksNotRegistered(externalClient);
-
-        // Register Cluster Ownership for ConnectionInfo
-        registerEntityForOwnership(client);
+        if(externalClient.getSchema(SouthboundConstants.OPEN_V_SWITCH) != null) {
+            OvsdbConnectionInstance client = connectedButCallBacksNotRegistered(externalClient);
+            // Register Cluster Ownership for ConnectionInfo
+            registerEntityForOwnership(client);
+        }
     }
 
     public OvsdbConnectionInstance connectedButCallBacksNotRegistered(final OvsdbClient externalClient) {