Fix: resolve an issue on not creating a new tenant bridge at node
Change-Id: I64be54971c6f8ef9db0c32408ab88ccb4dcebf28
(cherry picked from commit 45b158c1d150d15f51c97d632520b488db9aaf20)
diff --git a/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/impl/KubevirtNetworkHandler.java b/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/impl/KubevirtNetworkHandler.java
index 6617128..ed8e1e4 100644
--- a/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/impl/KubevirtNetworkHandler.java
+++ b/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/impl/KubevirtNetworkHandler.java
@@ -228,7 +228,7 @@
private void createBridge(KubevirtNode node, KubevirtNetwork network) {
Device tenantBridge = deviceService.getDevice(network.tenantDeviceId(node.hostname()));
- if (tenantBridge != null) {
+ if (tenantBridge != null && deviceService.isAvailable(tenantBridge.id())) {
log.warn("The tenant bridge {} already exists at node {}",
network.tenantBridgeName(), node.hostname());
setDefaultRulesForTenantNetwork(node, network);
@@ -270,6 +270,9 @@
BridgeConfig bridgeConfig = device.as(BridgeConfig.class);
bridgeConfig.addBridge(builder.build());
+ log.info("Created a new tunnel bridge for network {} at node {}",
+ network.networkId(), node.hostname());
+
waitFor(3);
}
}