|
|
@@ -1226,22 +1226,6 @@ class OpenStackGatewayService(BaseGatewayService):
|
|
|
def __init__(self, provider):
|
|
|
super(OpenStackGatewayService, self).__init__(provider)
|
|
|
|
|
|
- def _check_fip_connectivity(self, network, external_net):
|
|
|
- # Due to current limitations in OpenStack:
|
|
|
- # https://bugs.launchpad.net/neutron/+bug/1743480, it's not
|
|
|
- # possible to differentiate between floating ip networks and provider
|
|
|
- # external networks. Therefore, we systematically step through
|
|
|
- # all available networks and perform an assignment test to infer valid
|
|
|
- # floating ip nets.
|
|
|
- dummy_router = self._provider.networking.routers.create(
|
|
|
- label='cb-conn-test-router', network=network)
|
|
|
- with cb_helpers.cleanup_action(lambda: dummy_router.delete()):
|
|
|
- try:
|
|
|
- dummy_router.attach_gateway(external_net)
|
|
|
- return True
|
|
|
- except Exception:
|
|
|
- return False
|
|
|
-
|
|
|
@dispatch(event="provider.networking.gateways.get_or_create",
|
|
|
priority=BaseGatewayService.STANDARD_EVENT_PRIORITY)
|
|
|
def get_or_create(self, network):
|
|
|
@@ -1249,7 +1233,7 @@ class OpenStackGatewayService(BaseGatewayService):
|
|
|
external_nets = (n for n in self._provider.networking.networks
|
|
|
if n.external)
|
|
|
for net in external_nets:
|
|
|
- if self._check_fip_connectivity(network, net):
|
|
|
+ if not net.shared:
|
|
|
return OpenStackInternetGateway(self._provider, net)
|
|
|
return None
|
|
|
|
|
|
@@ -1264,7 +1248,7 @@ class OpenStackGatewayService(BaseGatewayService):
|
|
|
log.debug("OpenStack listing of all current internet gateways")
|
|
|
igl = [OpenStackInternetGateway(self._provider, n)
|
|
|
for n in self._provider.networking.networks
|
|
|
- if n.external and self._check_fip_connectivity(network, n)]
|
|
|
+ if n.external and not n.shared]
|
|
|
return ClientPagedResultList(self._provider, igl, limit=limit,
|
|
|
marker=marker)
|
|
|
|