Browse Source

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

changes/37/793437/1
Zuul 3 weeks ago
committed by Gerrit Code Review
parent
commit
c799b13776
3 changed files with 20 additions and 7 deletions
  1. +3
    -2
      manila/share/drivers/helpers.py
  2. +13
    -5
      manila/tests/share/drivers/test_helpers.py
  3. +4
    -0
      releasenotes/notes/bug-1911695-resize-share-world-accessable-b444d88b67b05af0.yaml

+ 3
- 2
manila/share/drivers/helpers.py 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


+ 13
- 5
manila/tests/share/drivers/test_helpers.py 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(


+ 4
- 0
releasenotes/notes/bug-1911695-resize-share-world-accessable-b444d88b67b05af0.yaml View File

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

Loading…
Cancel
Save