NetApp: Disable tunneling in vserver_exists

When share server is in error state in Manila and backend vserver has
not been created, there exist entries of share server and shares in
database. Deletion of share in such case cause share in error_deleting
state. In order to delete share correctly, we need to fix _get_vserver
which should check vserver existence before building the vserver
client.

Closes-Bug: #1964592
Change-Id: I1f6b94a7e54403a559a5d77b4d93b939a40e76bf
This commit is contained in:
Maurice Escher 2022-03-30 13:41:09 +00:00 committed by Kiran Pawar
parent 1d4beed95b
commit 224d3aa4dd
4 changed files with 12 additions and 3 deletions

View File

@ -56,7 +56,8 @@ class NetAppBaseClient(object):
if cached:
return self.connection.get_system_version()
result = self.send_request('system-get-version')
result = self.send_request('system-get-version',
enable_tunneling=False)
version_tuple = result.get_child_by_name(
'version-tuple') or netapp_api.NaElement('none')

View File

@ -291,7 +291,8 @@ class NetAppCmodeClient(client_base.NetAppBaseClient):
},
}
try:
result = self.send_iter_request('vserver-get-iter', api_args)
result = self.send_iter_request('vserver-get-iter', api_args,
enable_tunneling=False)
except netapp_api.NaApiError as e:
if e.code == netapp_api.EVSERVERNOTFOUND:
return False

View File

@ -402,7 +402,8 @@ class NetAppClientCmodeTestCase(test.TestCase):
result = self.client.vserver_exists(fake.VSERVER_NAME)
self.client.send_iter_request.assert_has_calls([
mock.call('vserver-get-iter', vserver_get_args)])
mock.call('vserver-get-iter', vserver_get_args,
enable_tunneling=False)])
self.assertTrue(result)
def test_vserver_exists_not_found(self):

View File

@ -0,0 +1,6 @@
---
fixes:
- |
NetApp driver: driver can now delete the share server in error state that
had not been created on storage side. For more details, please refer to
`launchpad bug #1964592 <https://bugs.launchpad.net/manila/+bug/1964592>`_