]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix signature of _create_volume() in ThinLVMVolumeDriver
authorEric Harney <eharney@redhat.com>
Sat, 10 Aug 2013 20:12:59 +0000 (16:12 -0400)
committerEric Harney <eharney@redhat.com>
Sat, 10 Aug 2013 20:44:29 +0000 (16:44 -0400)
create_volume_from_snapshot will call _create_volume() with the
wrong parameters when using ThinLVMVolumeDriver.  It should be
compatible with LVMVolumeDriver's _create_volume() method.

Fixes bug: 1210853

Change-Id: I18f7baf60601b3bcf01425b505a0579a826f072e

cinder/volume/drivers/lvm.py

index 6b54142978a6d6e23086d429de4fdec535d840ea..83fd5a3c75aab42a26bbc8d6713457fc065e93f8 100644 (file)
@@ -856,16 +856,11 @@ class ThinLVMVolumeDriver(LVMISCSIDriver):
             self._try_execute('lvcreate', '-s', '-n', new_name,
                               src_lvm_name, run_as_root=True)
 
-    def _create_volume(self, volume):
-        sizestr = self._sizestr(volume['size'])
+    def _create_volume(self, volume_name, sizestr):
         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)
+                          volume_name, vg_name, run_as_root=True)
 
     def delete_volume(self, volume):
         """Deletes a logical volume."""