client.getConnectionInfo().getRemotePort(),
client.getConnectionInfo().getLocalAddress(),
client.getConnectionInfo().getLocalPort());
- if(client.getSchema(HwvtepSchemaConstants.HARDWARE_VTEP) != null) {
+ List<String> databases = new ArrayList<>();
+ try {
+ databases = client.getDatabases().get();
+ } catch (InterruptedException | ExecutionException e) {
+ LOG.warn("Unable to fetch database list");
+ }
+
+ if(databases.contains(HwvtepSchemaConstants.HARDWARE_VTEP)) {
HwvtepConnectionInstance hwClient = connectedButCallBacksNotRegistered(client);
registerEntityForOwnership(hwClient);
}
externalClient.getConnectionInfo().getRemotePort(),
externalClient.getConnectionInfo().getLocalAddress(),
externalClient.getConnectionInfo().getLocalPort());
- if(externalClient.getSchema(SouthboundConstants.OPEN_V_SWITCH) != null) {
+ List<String> databases = new ArrayList<>();
+ try {
+ databases = externalClient.getDatabases().get();
+ } catch (InterruptedException | ExecutionException e) {
+ LOG.warn("Unable to fetch database list");
+ }
+
+ if(databases.contains(SouthboundConstants.OPEN_V_SWITCH)) {
OvsdbConnectionInstance client = connectedButCallBacksNotRegistered(externalClient);
// Register Cluster Ownership for ConnectionInfo
registerEntityForOwnership(client);
import static org.mockito.Mockito.times;
import java.net.InetAddress;
+import java.util.Arrays;
+import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
when(externalClient.getConnectionInfo().getRemotePort()).thenReturn(8080);
when(externalClient.getConnectionInfo().getLocalAddress()).thenReturn(mock(InetAddress.class));
when(externalClient.getConnectionInfo().getLocalPort()).thenReturn(8080);
+ List<String> databases = Arrays.asList("Open_vSwitch");
+ when(externalClient.getDatabases().get()).thenReturn(databases);
PowerMockito.mockStatic(SouthboundUtil.class);
when(SouthboundUtil.connectionInfoToString(any(ConnectionInfo.class))).thenReturn("192.18.120.31:8080");