Merge "Fix generic share resize with 0.0.0.0/24 access" into stable/train

This commit is contained in:
Zuul 2021-12-13 20:40:18 +00:00 committed by Gerrit Code Review
commit ac1efe911f
3 changed files with 20 additions and 7 deletions

View File

@ -383,8 +383,9 @@ class NFSHelper(NASHelperBase):
out, err = self._ssh_exec(server, ['sudo', 'exportfs'])
hosts = self.get_host_list(out, local_path)
for host in hosts:
self._ssh_exec(server, ['sudo', 'exportfs', '-u',
':'.join((host, local_path))])
self._ssh_exec(server,
['sudo', 'exportfs', '-u',
'"{}"'.format(':'.join((host, local_path)))])
self._sync_nfs_temp_and_perm_files(server)
@nfs_synchronized

View File

@ -355,13 +355,16 @@ class NFSHelperTestCase(test.TestCase):
@ddt.data(
('/shares/fake_share1\n\t\t1.1.1.10\n'
'/shares/fake_share2\n\t\t1.1.1.16\n'
'/shares/fake_share3\n\t\t<world>\n'
'/mnt/fake_share1 1.1.1.11', False),
('/shares/fake_share_name\n\t\t1.1.1.10\n'
'/shares/fake_share_name\n\t\t1.1.1.16\n'
'/shares/fake_share_name\n\t\t<world>\n'
'/mnt/fake_share1\n\t\t1.1.1.11', True),
('/mnt/fake_share_name\n\t\t1.1.1.11\n'
'/shares/fake_share_name\n\t\t1.1.1.10\n'
'/shares/fake_share_name\n\t\t1.1.1.16\n', True))
'/shares/fake_share_name\n\t\t1.1.1.16\n'
'/shares/fake_share_name\n\t\t<world>\n', True))
@ddt.unpack
def test_disable_access_for_maintenance(self, output, hosts_match):
fake_maintenance_path = "fake.path"
@ -397,10 +400,15 @@ class NFSHelperTestCase(test.TestCase):
if hosts_match:
self._helper._ssh_exec.assert_has_calls([
mock.call(self.server, ['sudo', 'exportfs', '-u',
':'.join(['1.1.1.10', local_path])]),
mock.call(self.server, ['sudo', 'exportfs', '-u',
':'.join(['1.1.1.16', local_path])]),
mock.call(self.server,
['sudo', 'exportfs', '-u',
'"{}"'.format(':'.join(['1.1.1.10', local_path]))]),
mock.call(self.server,
['sudo', 'exportfs', '-u',
'"{}"'.format(':'.join(['1.1.1.16', local_path]))]),
mock.call(self.server,
['sudo', 'exportfs', '-u',
'"{}"'.format(':'.join(['<world>', local_path]))]),
])
self._helper._sync_nfs_temp_and_perm_files.assert_called_once_with(

View File

@ -0,0 +1,4 @@
---
fixes:
- |
Resizing 0.0.0.0/24 accessible NFS shares with generic driver