Merge "NetApp cDOT driver clones NFS export policy"
This commit is contained in:
commit
3ae8a0fc36
@ -33,6 +33,7 @@ class NetAppCmodeNFSHelper(base.NetAppBaseHelper):
|
||||
@na_utils.trace
|
||||
def create_share(self, share, share_name, export_addresses):
|
||||
"""Creates NFS share."""
|
||||
self._client.clear_nfs_export_policy_for_volume(share_name)
|
||||
self._ensure_export_policy(share, share_name)
|
||||
export_path = self._client.get_volume_junction_path(share_name)
|
||||
return [':'.join([export_address, export_path])
|
||||
|
@ -50,6 +50,8 @@ class NetAppClusteredNFSHelperTestCase(test.TestCase):
|
||||
|
||||
expected = [':'.join([fake.SHARE_ADDRESS_1, fake.NFS_SHARE_PATH])]
|
||||
self.assertEqual(expected, result)
|
||||
self.mock_client.clear_nfs_export_policy_for_volume.\
|
||||
assert_called_once_with(fake.SHARE_NAME)
|
||||
self.assertTrue(mock_ensure_export_policy.called)
|
||||
|
||||
def test_create_share_multiple(self):
|
||||
@ -67,6 +69,8 @@ class NetAppClusteredNFSHelperTestCase(test.TestCase):
|
||||
expected = [':'.join([fake.SHARE_ADDRESS_1, fake.NFS_SHARE_PATH]),
|
||||
':'.join([fake.SHARE_ADDRESS_2, fake.NFS_SHARE_PATH])]
|
||||
self.assertEqual(expected, result)
|
||||
self.mock_client.clear_nfs_export_policy_for_volume.\
|
||||
assert_called_once_with(fake.SHARE_NAME)
|
||||
self.assertTrue(mock_ensure_export_policy.called)
|
||||
|
||||
def test_delete_share(self):
|
||||
@ -226,4 +230,4 @@ class NetAppClusteredNFSHelperTestCase(test.TestCase):
|
||||
|
||||
self.assertFalse(self.mock_client.create_nfs_export_policy.called)
|
||||
self.mock_client.rename_nfs_export_policy.assert_called_once_with(
|
||||
'fake', fake.EXPORT_POLICY_NAME)
|
||||
'fake', fake.EXPORT_POLICY_NAME)
|
||||
|
Loading…
Reference in New Issue
Block a user