Browse Source

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

changes/35/689635/2
Zuul 2 months ago
committed by Gerrit Code Review
parent
commit
892f1d60ae
5 changed files with 23 additions and 2 deletions
  1. +5
    -1
      manila/share/drivers/dell_emc/plugins/unity/client.py
  2. +3
    -1
      manila/share/drivers/dell_emc/plugins/unity/connection.py
  3. +4
    -0
      manila/tests/share/drivers/dell_emc/plugins/unity/fake_exceptions.py
  4. +7
    -0
      manila/tests/share/drivers/dell_emc/plugins/unity/test_client.py
  5. +4
    -0
      releasenotes/notes/bug-1845452-unity--fix-fail-to-delete-cifs-share-c502a10ae306e506.yaml

+ 5
- 1
manila/share/drivers/dell_emc/plugins/unity/client.py View File

@@ -274,7 +274,11 @@ class UnityClient(object):
def cifs_deny_access(self, share_name, user_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):
share = self.system.get_nfs_share(name=share_name)


+ 3
- 1
manila/share/drivers/dell_emc/plugins/unity/connection.py 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 import utils

VERSION = "4.0.1"
"""Version history:
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__)
SUPPORTED_NETWORK_TYPES = (None, 'flat', 'vlan')



+ 4
- 0
manila/tests/share/drivers/dell_emc/plugins/unity/fake_exceptions.py View File

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

class UnityVLANAlreadyHasInterfaceError(UnityException):
pass


class UnityAclUserNotFoundError(UnityException):
pass

+ 7
- 0
manila/tests/share/drivers/dell_emc/plugins/unity/test_client.py View File

@@ -160,6 +160,13 @@ class TestClient(test.TestCase):

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
def test_nfs_deny_access__nonexistent_expt(self, client):
client.nfs_deny_access('fake_share_name', 'fake_ip_addr')


+ 4
- 0
releasenotes/notes/bug-1845452-unity--fix-fail-to-delete-cifs-share-c502a10ae306e506.yaml View File

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

Loading…
Cancel
Save