[ONOS-6066]bug fix openstack node moudle
Change-Id: I9bc76e132c8cf76a2a9f7453a270e859fe0fab7d
diff --git a/apps/openstacknode/src/main/java/org/onosproject/openstacknode/OpenstackNodeManager.java b/apps/openstacknode/src/main/java/org/onosproject/openstacknode/OpenstackNodeManager.java
index a5bcaf5..09b4f52 100644
--- a/apps/openstacknode/src/main/java/org/onosproject/openstacknode/OpenstackNodeManager.java
+++ b/apps/openstacknode/src/main/java/org/onosproject/openstacknode/OpenstackNodeManager.java
@@ -337,7 +337,8 @@
}
private NodeState nodeState(OpenstackNode node) {
- if (!isOvsdbConnected(node) || !deviceService.isAvailable(node.intBridge())) {
+ if (!isOvsdbConnected(node) || !deviceService.isAvailable(node.intBridge()) ||
+ !isBridgeCreated(node.ovsdbId(), INTEGRATION_BRIDGE)) {
return INIT;
}
@@ -518,8 +519,9 @@
.findFirst().orElseGet(() -> nodes().stream()
.filter(n -> n.routerBridge().isPresent())
.filter(n -> n.routerBridge().get().equals(deviceId))
- .findFirst().orElse(null));
-
+ .findFirst().orElseGet(() -> nodes().stream()
+ .filter(n -> n.ovsdbId().equals(deviceId))
+ .findFirst().orElse(null)));
return node;
}