From: Victor Rodionov Date: Fri, 6 Sep 2013 22:18:48 +0000 (+0400) Subject: Fix bug in Nexenta NFS driver _do_create_volume X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=4ea6dfd0b1140e437703128bf52d65dbd2751751;p=openstack-build%2Fcinder-build.git Fix bug in Nexenta NFS driver _do_create_volume 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 --- diff --git a/cinder/tests/test_nexenta.py b/cinder/tests/test_nexenta.py index 674fab37c..4d7050d54 100644 --- a/cinder/tests/test_nexenta.py +++ b/cinder/tests/test_nexenta.py @@ -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('-')) diff --git a/cinder/volume/drivers/nexenta/nfs.py b/cinder/volume/drivers/nexenta/nfs.py index 8996c99d3..2aa7f938d 100644 --- a/cinder/volume/drivers/nexenta/nfs.py +++ b/cinder/volume/drivers/nexenta/nfs.py @@ -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)