Fix OpenstackRoutingFloatingIpHandler to retrieve external peer router.
Fix OpenstackRoutingFloatingIpHandler to retrieve external peer router properly.
Change-Id: Ia240bcd21f8c74a253f322e4bd6d138f3bd6a86a
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingFloatingIpHandler.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingFloatingIpHandler.java
index fe41bdc..bfe0257 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingFloatingIpHandler.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingFloatingIpHandler.java
@@ -382,32 +382,6 @@
}
private ExternalPeerRouter externalPeerRouter(Network network) {
- Subnet subnet = osNetworkService.subnet(network.getId());
-
- if (subnet == null) {
- return null;
- }
-
- RouterInterface osRouterIface = osRouterService.routerInterfaces().stream()
- .filter(i -> Objects.equals(i.getSubnetId(), subnet.getId()))
- .findAny().orElse(null);
- if (osRouterIface == null) {
- return null;
- }
-
- Router osRouter = osRouterService.router(osRouterIface.getId());
- if (osRouter == null) {
- return null;
- }
- if (osRouter.getExternalGatewayInfo() == null) {
- return null;
- }
-
- ExternalGateway exGatewayInfo = osRouter.getExternalGatewayInfo();
- return osNetworkService.externalPeerRouter(exGatewayInfo);
- }
-
- private MacAddress externalPeerRouterMac(Network network) {
if (network == null) {
return null;
}
@@ -434,9 +408,9 @@
}
ExternalGateway exGatewayInfo = osRouter.getExternalGatewayInfo();
-
- return osNetworkService.externalPeerRouterMac(exGatewayInfo);
+ return osNetworkService.externalPeerRouter(exGatewayInfo);
}
+
private class InternalFloatingIpListener implements OpenstackRouterListener {
@Override