summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-02-08 13:15:50 +0000
committerGerrit Code Review <review@openstack.org>2018-02-08 13:15:50 +0000
commit6368a9e887f5f3e51c8013c94fd92565279fb3e7 (patch)
treed0c7e235dd292146cb2d59bad7ce3e744128adef
parent0b2feb71a5e4bde2a9cab27fd8270ea018b0508f (diff)
parent73ef94d38fcf28d6de5133db662b19e06d86fde7 (diff)
Merge "Fix LVM driver not handling IPv6 in recovery mode"6.0.0.0rc1
-rw-r--r--manila/share/drivers/helpers.py3
-rw-r--r--manila/tests/share/drivers/test_helpers.py22
-rw-r--r--releasenotes/notes/bug-1746723-8b89633062885f0b.yaml5
3 files changed, 22 insertions, 8 deletions
diff --git a/manila/share/drivers/helpers.py b/manila/share/drivers/helpers.py
index 983b7d5..e302c5c 100644
--- a/manila/share/drivers/helpers.py
+++ b/manila/share/drivers/helpers.py
@@ -241,8 +241,9 @@ class NFSHelper(NASHelperBase):
241 241
242 hosts = self.get_host_list(out, local_path) 242 hosts = self.get_host_list(out, local_path)
243 for host in hosts: 243 for host in hosts:
244 parsed_host = self._get_parsed_address_or_cidr(host)
244 self._ssh_exec(server, ['sudo', 'exportfs', '-u', 245 self._ssh_exec(server, ['sudo', 'exportfs', '-u',
245 ':'.join((host, local_path))]) 246 ':'.join((parsed_host, local_path))])
246 self._sync_nfs_temp_and_perm_files(server) 247 self._sync_nfs_temp_and_perm_files(server)
247 for access in access_rules: 248 for access in access_rules:
248 rules_options = '%s,no_subtree_check,no_root_squash' 249 rules_options = '%s,no_subtree_check,no_root_squash'
diff --git a/manila/tests/share/drivers/test_helpers.py b/manila/tests/share/drivers/test_helpers.py
index ea704a5..6c5d9bf 100644
--- a/manila/tests/share/drivers/test_helpers.py
+++ b/manila/tests/share/drivers/test_helpers.py
@@ -226,14 +226,22 @@ class NFSHelperTestCase(test.TestCase):
226 result = self._helper.get_host_list(fake_exportfs, '/shares/share-1') 226 result = self._helper.get_host_list(fake_exportfs, '/shares/share-1')
227 self.assertEqual(expected, result) 227 self.assertEqual(expected, result)
228 228
229 @ddt.data(const.ACCESS_LEVEL_RW, const.ACCESS_LEVEL_RO) 229 @ddt.data({"level": const.ACCESS_LEVEL_RW, "ip": "1.1.1.1",
230 def test_update_access_recovery_mode(self, access_level): 230 "expected": "1.1.1.1"},
231 {"level": const.ACCESS_LEVEL_RO, "ip": "1.1.1.1",
232 "expected": "1.1.1.1"},
233 {"level": const.ACCESS_LEVEL_RW, "ip": "fd12:abcd::10",
234 "expected": "[fd12:abcd::10]"},
235 {"level": const.ACCESS_LEVEL_RO, "ip": "fd12:abcd::10",
236 "expected": "[fd12:abcd::10]"})
237 @ddt.unpack
238 def test_update_access_recovery_mode(self, level, ip, expected):
231 expected_mount_options = '%s,no_subtree_check,no_root_squash' 239 expected_mount_options = '%s,no_subtree_check,no_root_squash'
232 access_rules = [test_generic.get_fake_access_rule( 240 access_rules = [test_generic.get_fake_access_rule(
233 '1.1.1.1', access_level), ] 241 ip, level), ]
234 self.mock_object(self._helper, '_sync_nfs_temp_and_perm_files') 242 self.mock_object(self._helper, '_sync_nfs_temp_and_perm_files')
235 self.mock_object(self._helper, 'get_host_list', 243 self.mock_object(self._helper, 'get_host_list',
236 mock.Mock(return_value=['1.1.1.1'])) 244 mock.Mock(return_value=[ip]))
237 self._helper.update_access(self.server, self.share_name, access_rules, 245 self._helper.update_access(self.server, self.share_name, access_rules,
238 [], []) 246 [], [])
239 local_path = os.path.join(CONF.share_mount_path, self.share_name) 247 local_path = os.path.join(CONF.share_mount_path, self.share_name)
@@ -241,11 +249,11 @@ class NFSHelperTestCase(test.TestCase):
241 mock.call(self.server, ['sudo', 'exportfs']), 249 mock.call(self.server, ['sudo', 'exportfs']),
242 mock.call( 250 mock.call(
243 self.server, ['sudo', 'exportfs', '-u', 251 self.server, ['sudo', 'exportfs', '-u',
244 ':'.join([access_rules[0]['access_to'], 252 ':'.join([expected,
245 local_path])]), 253 local_path])]),
246 mock.call(self.server, ['sudo', 'exportfs', '-o', 254 mock.call(self.server, ['sudo', 'exportfs', '-o',
247 expected_mount_options % access_level, 255 expected_mount_options % level,
248 ':'.join(['1.1.1.1', local_path])]), 256 ':'.join([expected, local_path])]),
249 ]) 257 ])
250 self._helper._sync_nfs_temp_and_perm_files.assert_called_with( 258 self._helper._sync_nfs_temp_and_perm_files.assert_called_with(
251 self.server) 259 self.server)
diff --git a/releasenotes/notes/bug-1746723-8b89633062885f0b.yaml b/releasenotes/notes/bug-1746723-8b89633062885f0b.yaml
new file mode 100644
index 0000000..05d1455
--- /dev/null
+++ b/releasenotes/notes/bug-1746723-8b89633062885f0b.yaml
@@ -0,0 +1,5 @@
1---
2fixes:
3 - LVM driver now correctly parses IPv6 addresses during a Host-assisted
4 share migration.
5