Merge "Fix generic share resize with 0.0.0.0/24 access" into stable/victoria
This commit is contained in:
commit
c799b13776
|
@ -383,8 +383,9 @@ class NFSHelper(NASHelperBase):
|
||||||
out, err = self._ssh_exec(server, ['sudo', 'exportfs'])
|
out, err = self._ssh_exec(server, ['sudo', 'exportfs'])
|
||||||
hosts = self.get_host_list(out, local_path)
|
hosts = self.get_host_list(out, local_path)
|
||||||
for host in hosts:
|
for host in hosts:
|
||||||
self._ssh_exec(server, ['sudo', 'exportfs', '-u',
|
self._ssh_exec(server,
|
||||||
':'.join((host, local_path))])
|
['sudo', 'exportfs', '-u',
|
||||||
|
'"{}"'.format(':'.join((host, local_path)))])
|
||||||
self._sync_nfs_temp_and_perm_files(server)
|
self._sync_nfs_temp_and_perm_files(server)
|
||||||
|
|
||||||
@nfs_synchronized
|
@nfs_synchronized
|
||||||
|
|
|
@ -355,13 +355,16 @@ class NFSHelperTestCase(test.TestCase):
|
||||||
@ddt.data(
|
@ddt.data(
|
||||||
('/shares/fake_share1\n\t\t1.1.1.10\n'
|
('/shares/fake_share1\n\t\t1.1.1.10\n'
|
||||||
'/shares/fake_share2\n\t\t1.1.1.16\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),
|
'/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.10\n'
|
||||||
'/shares/fake_share_name\n\t\t1.1.1.16\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_share1\n\t\t1.1.1.11', True),
|
||||||
('/mnt/fake_share_name\n\t\t1.1.1.11\n'
|
('/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.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
|
@ddt.unpack
|
||||||
def test_disable_access_for_maintenance(self, output, hosts_match):
|
def test_disable_access_for_maintenance(self, output, hosts_match):
|
||||||
fake_maintenance_path = "fake.path"
|
fake_maintenance_path = "fake.path"
|
||||||
|
@ -397,10 +400,15 @@ class NFSHelperTestCase(test.TestCase):
|
||||||
|
|
||||||
if hosts_match:
|
if hosts_match:
|
||||||
self._helper._ssh_exec.assert_has_calls([
|
self._helper._ssh_exec.assert_has_calls([
|
||||||
mock.call(self.server, ['sudo', 'exportfs', '-u',
|
mock.call(self.server,
|
||||||
':'.join(['1.1.1.10', local_path])]),
|
['sudo', 'exportfs', '-u',
|
||||||
mock.call(self.server, ['sudo', 'exportfs', '-u',
|
'"{}"'.format(':'.join(['1.1.1.10', local_path]))]),
|
||||||
':'.join(['1.1.1.16', 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(
|
self._helper._sync_nfs_temp_and_perm_files.assert_called_once_with(
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Resizing 0.0.0.0/24 accessible NFS shares with generic driver
|
Loading…
Reference in New Issue