NetApp cDOT driver skip vserver route with no gateway

Skip route creation if user decided to configure neutron network
without a gateway.

Closes-Bug: #1777126
Change-Id: Ic54e3aa7fc8327464110fff40d02c690d8b19122
This commit is contained in:
Maurice Schreiber 2018-02-01 16:27:40 +01:00 committed by Goutham Pacha Ravi
parent 95de4d2134
commit a7c4eb9c19
3 changed files with 12 additions and 0 deletions

View File

@ -659,6 +659,8 @@ class NetAppCmodeClient(client_base.NetAppBaseClient):
@na_utils.trace
def create_route(self, gateway, destination=None):
if not gateway:
return
if not destination:
if ':' in gateway:
destination = '::/0'

View File

@ -1249,6 +1249,11 @@ class NetAppClientCmodeTestCase(test.TestCase):
self.client.send_request.assert_called_once_with(
'net-routes-create', expected_api_args)
def test_create_route_without_gateway(self):
self.mock_object(self.client, 'send_request')
self.client.create_route(None, destination=fake.SUBNET)
self.assertFalse(self.client.send_request.called)
def test_ensure_broadcast_domain_for_port_domain_match(self):
port_info = {

View File

@ -0,0 +1,5 @@
---
fixes:
- The NetApp driver has been fixed to not enforce route creation when the
share network provided has no gateway. See `Launchpad bug 1777126
<https://bugs.launchpad.net/manila/+bug/1777126>`_ for details.