Merge "[Unity]: Failed to delete cifs share if wrong access set" into stable/rocky

This commit is contained in:
Zuul 2020-05-27 21:12:56 +00:00 committed by Gerrit Code Review
commit 892f1d60ae
5 changed files with 23 additions and 2 deletions

View File

@ -274,7 +274,11 @@ class UnityClient(object):
def cifs_deny_access(self, share_name, user_name): def cifs_deny_access(self, share_name, user_name):
share = self.system.get_cifs_share(name=share_name) share = self.system.get_cifs_share(name=share_name)
share.delete_ace(user=user_name) try:
share.delete_ace(user=user_name)
except storops_ex.UnityAclUserNotFoundError:
LOG.debug('ACL User "%(user)s" does not exist.',
{'user': user_name})
def nfs_deny_access(self, share_name, host_ip): def nfs_deny_access(self, share_name, host_ip):
share = self.system.get_nfs_share(name=share_name) share = self.system.get_nfs_share(name=share_name)

View File

@ -36,11 +36,13 @@ from manila.share.drivers.dell_emc.plugins.unity import utils as unity_utils
from manila.share import utils as share_utils from manila.share import utils as share_utils
from manila import utils from manila import utils
VERSION = "4.0.1"
"""Version history: """Version history:
4.0.1 - Fix parsing management IPv6 address 4.0.1 - Fix parsing management IPv6 address
5.0.1 - Bugfix: failed to delete CIFS share if wrong access was set
""" """
VERSION = "5.0.1"
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)
SUPPORTED_NETWORK_TYPES = (None, 'flat', 'vlan') SUPPORTED_NETWORK_TYPES = (None, 'flat', 'vlan')

View File

@ -84,3 +84,7 @@ class SystemAPINotSupported(UnityException):
class UnityVLANAlreadyHasInterfaceError(UnityException): class UnityVLANAlreadyHasInterfaceError(UnityException):
pass pass
class UnityAclUserNotFoundError(UnityException):
pass

View File

@ -160,6 +160,13 @@ class TestClient(test.TestCase):
client.delete_snapshot(snapshot) client.delete_snapshot(snapshot)
@res_mock.patch_client
def test_cifs_deny_access__nonexistentuser_expt(self, client):
try:
client.cifs_deny_access('fake_share_name', 'fake_username')
except fake_exceptions.UnityAclUserNotFoundError:
self.fail("UnityAclUserNotFoundError raised unexpectedly!")
@res_mock.patch_client @res_mock.patch_client
def test_nfs_deny_access__nonexistent_expt(self, client): def test_nfs_deny_access__nonexistent_expt(self, client):
client.nfs_deny_access('fake_share_name', 'fake_ip_addr') client.nfs_deny_access('fake_share_name', 'fake_ip_addr')

View File

@ -0,0 +1,4 @@
---
fixes:
- Fixed an issue with Unity driver fails to delete CIFS share if wrong
access was set.