summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-04-23 15:54:32 +0000
committerGerrit Code Review <review@openstack.org>2015-04-23 15:54:32 +0000
commitec56e0b64a55014ba6e166e787017b4ddd690342 (patch)
treecf265d49bcd6c7135a09bf51e801a6cdb687a310
parent970a4f7c617e2a1caf8ec704d6c9b8b5d8c20e7d (diff)
parent1ce9384b652fdc55a35a6d8999d54e04a715fd68 (diff)
Merge "NetApp cDOT driver clones NFS export policy" into stable/kilo2015.1.0rc22015.1.0
-rw-r--r--manila/share/drivers/netapp/dataontap/protocols/nfs_cmode.py1
-rw-r--r--manila/tests/share/drivers/netapp/dataontap/protocols/test_nfs_cmode.py6
2 files changed, 6 insertions, 1 deletions
diff --git a/manila/share/drivers/netapp/dataontap/protocols/nfs_cmode.py b/manila/share/drivers/netapp/dataontap/protocols/nfs_cmode.py
index 2f02ff9..55464ae 100644
--- a/manila/share/drivers/netapp/dataontap/protocols/nfs_cmode.py
+++ b/manila/share/drivers/netapp/dataontap/protocols/nfs_cmode.py
@@ -33,6 +33,7 @@ class NetAppCmodeNFSHelper(base.NetAppBaseHelper):
33 @na_utils.trace 33 @na_utils.trace
34 def create_share(self, share, share_name, export_addresses): 34 def create_share(self, share, share_name, export_addresses):
35 """Creates NFS share.""" 35 """Creates NFS share."""
36 self._client.clear_nfs_export_policy_for_volume(share_name)
36 self._ensure_export_policy(share, share_name) 37 self._ensure_export_policy(share, share_name)
37 export_path = self._client.get_volume_junction_path(share_name) 38 export_path = self._client.get_volume_junction_path(share_name)
38 return [':'.join([export_address, export_path]) 39 return [':'.join([export_address, export_path])
diff --git a/manila/tests/share/drivers/netapp/dataontap/protocols/test_nfs_cmode.py b/manila/tests/share/drivers/netapp/dataontap/protocols/test_nfs_cmode.py
index 94b28ea..6645977 100644
--- a/manila/tests/share/drivers/netapp/dataontap/protocols/test_nfs_cmode.py
+++ b/manila/tests/share/drivers/netapp/dataontap/protocols/test_nfs_cmode.py
@@ -50,6 +50,8 @@ class NetAppClusteredNFSHelperTestCase(test.TestCase):
50 50
51 expected = [':'.join([fake.SHARE_ADDRESS_1, fake.NFS_SHARE_PATH])] 51 expected = [':'.join([fake.SHARE_ADDRESS_1, fake.NFS_SHARE_PATH])]
52 self.assertEqual(expected, result) 52 self.assertEqual(expected, result)
53 self.mock_client.clear_nfs_export_policy_for_volume.\
54 assert_called_once_with(fake.SHARE_NAME)
53 self.assertTrue(mock_ensure_export_policy.called) 55 self.assertTrue(mock_ensure_export_policy.called)
54 56
55 def test_create_share_multiple(self): 57 def test_create_share_multiple(self):
@@ -67,6 +69,8 @@ class NetAppClusteredNFSHelperTestCase(test.TestCase):
67 expected = [':'.join([fake.SHARE_ADDRESS_1, fake.NFS_SHARE_PATH]), 69 expected = [':'.join([fake.SHARE_ADDRESS_1, fake.NFS_SHARE_PATH]),
68 ':'.join([fake.SHARE_ADDRESS_2, fake.NFS_SHARE_PATH])] 70 ':'.join([fake.SHARE_ADDRESS_2, fake.NFS_SHARE_PATH])]
69 self.assertEqual(expected, result) 71 self.assertEqual(expected, result)
72 self.mock_client.clear_nfs_export_policy_for_volume.\
73 assert_called_once_with(fake.SHARE_NAME)
70 self.assertTrue(mock_ensure_export_policy.called) 74 self.assertTrue(mock_ensure_export_policy.called)
71 75
72 def test_delete_share(self): 76 def test_delete_share(self):
@@ -226,4 +230,4 @@ class NetAppClusteredNFSHelperTestCase(test.TestCase):
226 230
227 self.assertFalse(self.mock_client.create_nfs_export_policy.called) 231 self.assertFalse(self.mock_client.create_nfs_export_policy.called)
228 self.mock_client.rename_nfs_export_policy.assert_called_once_with( 232 self.mock_client.rename_nfs_export_policy.assert_called_once_with(
229 'fake', fake.EXPORT_POLICY_NAME) \ No newline at end of file 233 'fake', fake.EXPORT_POLICY_NAME)