Cannot remove user rule for NFS share
Use generic driver create share, then add user type access failed. We can not use 'manila access-deny' to delete the user rule in a NFS share db. This path fix this issue. Change-Id: I9375c4be9361d593102a382eb9c14c2d776bb1aa Closes-Bug:#1591357
This commit is contained in:
parent
ed99505bb0
commit
7498954506
@ -263,8 +263,6 @@ class NFSHelper(NASHelperBase):
|
||||
(const.ACCESS_LEVEL_RO, const.ACCESS_LEVEL_RW))
|
||||
|
||||
for access in delete_rules:
|
||||
access_to = self._get_parsed_address_or_cidr(
|
||||
access['access_to'])
|
||||
try:
|
||||
self.validate_access_rules(
|
||||
[access], ('ip',),
|
||||
@ -278,6 +276,8 @@ class NFSHelper(NASHelperBase):
|
||||
'type': access['access_type'],
|
||||
'to': access['access_to']})
|
||||
continue
|
||||
access_to = self._get_parsed_address_or_cidr(
|
||||
access['access_to'])
|
||||
self._ssh_exec(server, ['sudo', 'exportfs', '-u',
|
||||
':'.join((access_to, local_path))])
|
||||
if delete_rules:
|
||||
|
@ -215,6 +215,15 @@ class NFSHelperTestCase(test.TestCase):
|
||||
[],
|
||||
[])
|
||||
|
||||
def test_update_access_delete_invalid_rule(self):
|
||||
delete_rules = [test_generic.get_fake_access_rule(
|
||||
'lala', 'fake_level', access_type='user'), ]
|
||||
self.mock_object(self._helper, '_sync_nfs_temp_and_perm_files')
|
||||
self._helper.update_access(self.server, self.share_name, [],
|
||||
[], delete_rules)
|
||||
self._helper._sync_nfs_temp_and_perm_files.assert_called_with(
|
||||
self.server)
|
||||
|
||||
def test_get_host_list(self):
|
||||
fake_exportfs = ('/shares/share-1\n\t\t20.0.0.3\n'
|
||||
'/shares/share-1\n\t\t20.0.0.6\n'
|
||||
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
fixes:
|
||||
- The generic driver has been fixed to allow removing
|
||||
inappropriate CIFS rules on NFS shares.
|
Loading…
Reference in New Issue
Block a user