]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix bug in Nexenta NFS driver _do_create_volume
authorVictor Rodionov <vito.ordaz@gmail.com>
Fri, 6 Sep 2013 22:18:48 +0000 (02:18 +0400)
committerVictor Rodionov <vito.ordaz@gmail.com>
Mon, 9 Sep 2013 16:26:12 +0000 (20:26 +0400)
Fix bug in _do_create_volume method of Nexenta NFS volume driver.
NMS call nms.folder.create doesn't support third argument, that is why
this call changed to nms.folder.create_with_opts.

Closes-Bug: #1221946
Change-Id: I712ee2919f1bd117e7a1691979639689d95adc92

cinder/tests/test_nexenta.py
cinder/volume/drivers/nexenta/nfs.py

index 674fab37c0dc9a5d06296248faa172fc03695c67..4d7050d541b8dcfe9fc85133219b73ca4ac24604 100644 (file)
@@ -451,8 +451,8 @@ class TestNexentaNfsDriver(test.TestCase):
 
         compression = self.configuration.nexenta_volume_compression
         self.nms_mock.server.get_prop('volroot').AndReturn('/volumes')
-        self.nms_mock.folder.create('stack', 'share/volume-1',
-                                    '-o compression=%s' % compression)
+        self.nms_mock.folder.create_with_opts(
+            'stack', 'share/volume-1', {'compression': compression})
         self.nms_mock.netstorsvc.share_folder(self.TEST_SHARE_SVC,
                                               'stack/share/volume-1',
                                               self.TEST_SHARE_OPTS)
@@ -470,8 +470,8 @@ class TestNexentaNfsDriver(test.TestCase):
         self.mox.ResetAll()
 
         self.nms_mock.server.get_prop('volroot').AndReturn('/volumes')
-        self.nms_mock.folder.create('stack', 'share/volume-1',
-                                    '-o compression=%s' % compression)
+        self.nms_mock.folder.create_with_opts(
+            'stack', 'share/volume-1', {'compression': compression})
         self.nms_mock.netstorsvc.share_folder(
             self.TEST_SHARE_SVC, 'stack/share/volume-1',
             self.TEST_SHARE_OPTS).AndRaise(nexenta.NexentaException('-'))
index 8996c99d3d41b54554fe03d0b733a4547b40316a..2aa7f938d16141f3d675992003126760ab260f52 100644 (file)
@@ -102,9 +102,9 @@ class NexentaNfsDriver(nfs.NfsDriver):  # pylint: disable=R0921
         vol, dataset = self._get_share_datasets(nfs_share)
         folder = '%s/%s' % (dataset, volume['name'])
         LOG.debug(_('Creating folder on Nexenta Store %s'), folder)
-        nms.folder.create(
+        nms.folder.create_with_opts(
             vol, folder,
-            '-o compression=%s' % self.configuration.nexenta_volume_compression
+            {'compression': self.configuration.nexenta_volume_compression}
         )
 
         volume_path = self.remote_path(volume)