Browse Source

Merge "NetApp cDOT driver clones NFS export policy" into stable/kilo

Jenkins 4 years ago
parent
commit
ec56e0b64a

+ 1
- 0
manila/share/drivers/netapp/dataontap/protocols/nfs_cmode.py View File

@@ -33,6 +33,7 @@ class NetAppCmodeNFSHelper(base.NetAppBaseHelper):
33 33
     @na_utils.trace
34 34
     def create_share(self, share, share_name, export_addresses):
35 35
         """Creates NFS share."""
36
+        self._client.clear_nfs_export_policy_for_volume(share_name)
36 37
         self._ensure_export_policy(share, share_name)
37 38
         export_path = self._client.get_volume_junction_path(share_name)
38 39
         return [':'.join([export_address, export_path])

+ 5
- 1
manila/tests/share/drivers/netapp/dataontap/protocols/test_nfs_cmode.py View File

@@ -50,6 +50,8 @@ class NetAppClusteredNFSHelperTestCase(test.TestCase):
50 50
 
51 51
         expected = [':'.join([fake.SHARE_ADDRESS_1, fake.NFS_SHARE_PATH])]
52 52
         self.assertEqual(expected, result)
53
+        self.mock_client.clear_nfs_export_policy_for_volume.\
54
+            assert_called_once_with(fake.SHARE_NAME)
53 55
         self.assertTrue(mock_ensure_export_policy.called)
54 56
 
55 57
     def test_create_share_multiple(self):
@@ -67,6 +69,8 @@ class NetAppClusteredNFSHelperTestCase(test.TestCase):
67 69
         expected = [':'.join([fake.SHARE_ADDRESS_1, fake.NFS_SHARE_PATH]),
68 70
                     ':'.join([fake.SHARE_ADDRESS_2, fake.NFS_SHARE_PATH])]
69 71
         self.assertEqual(expected, result)
72
+        self.mock_client.clear_nfs_export_policy_for_volume.\
73
+            assert_called_once_with(fake.SHARE_NAME)
70 74
         self.assertTrue(mock_ensure_export_policy.called)
71 75
 
72 76
     def test_delete_share(self):
@@ -226,4 +230,4 @@ class NetAppClusteredNFSHelperTestCase(test.TestCase):
226 230
 
227 231
         self.assertFalse(self.mock_client.create_nfs_export_policy.called)
228 232
         self.mock_client.rename_nfs_export_policy.assert_called_once_with(
229
-            'fake', fake.EXPORT_POLICY_NAME)
233
+            'fake', fake.EXPORT_POLICY_NAME)

Loading…
Cancel
Save