]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Add _create_volume to ThinLVMVolumeDriver
authorEric Harney <eharney@redhat.com>
Wed, 19 Jun 2013 20:31:07 +0000 (16:31 -0400)
committerEric Harney <eharney@redhat.com>
Thu, 20 Jun 2013 14:15:56 +0000 (10:15 -0400)
Previously, _create_volume from LVMISCSIDriver would be called
when the volume manager calls create_volume_from_snapshot.

Fixes bug: 1192601

Change-Id: I5cca287e8204c4647a5f09df961d9a76d0b38c42

cinder/volume/drivers/lvm.py

index 3c214cc5f5d586094251f329f548a5c82536cf7b..756b4d66dcbe62dfb653c45a8d43f8a00fe3b99a 100644 (file)
@@ -643,16 +643,17 @@ class ThinLVMVolumeDriver(LVMISCSIDriver):
             self._try_execute('lvcreate', '-s', '-n', new_name,
                               src_lvm_name, run_as_root=True)
 
-    def create_volume(self, volume):
-        """Creates a logical volume. Can optionally return a Dictionary of
-        changes to the volume object to be persisted.
-        """
+    def _create_volume(self, volume):
         sizestr = self._sizestr(volume['size'])
         vg_name = ("%s/%s-pool" % (self.configuration.volume_group,
                                    self.configuration.volume_group))
         self._try_execute('lvcreate', '-T', '-V', sizestr, '-n',
                           volume['name'], vg_name, run_as_root=True)
 
+    def create_volume(self, volume):
+        """Creates a logical volume."""
+        self._create_volume(volume)
+
     def delete_volume(self, volume):
         """Deletes a logical volume."""
         if self._volume_not_present(volume['name']):