]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix broken export commands on block_device driver
authorJohn Griffith <john.griffith@solidfire.com>
Tue, 16 Jun 2015 19:15:43 +0000 (13:15 -0600)
committerJohn Griffith <john.griffith@solidfire.com>
Tue, 16 Jun 2015 19:18:06 +0000 (13:18 -0600)
When I implemented the new target driver code the
methods used for LVM were copy pasted:
 commit 9651f547147188645942466602c92cce06666483

I screwed this up because the block_device driver
doesn't use LVM at all.

This patch sets it back the way it should be and just
uses the local dev file of the whole disk.

Change-Id: Ife88d5597df27dcd668a9a361bebccbc840ca2d4
Closes-Bug: #1465819

cinder/volume/drivers/block_device.py

index cfe87663827b0efdae3a94832effc30eb77f7d37..bed0c5867bc4433c7b9d41bf076af13d5e818aae 100644 (file)
@@ -191,8 +191,7 @@ class BlockDeviceDriver(driver.BaseVD, driver.LocalVD, driver.CloneableVD,
     # #######  Interface methods for DataPath (Target Driver) ########
 
     def ensure_export(self, context, volume):
-        volume_path = "/dev/%s/%s" % (self.configuration.volume_group,
-                                      volume['name'])
+        volume_path = self.local_path(volume)
         model_update = \
             self.target_driver.ensure_export(
                 context,
@@ -201,8 +200,7 @@ class BlockDeviceDriver(driver.BaseVD, driver.LocalVD, driver.CloneableVD,
         return model_update
 
     def create_export(self, context, volume):
-        volume_path = "/dev/%s/%s" % (self.configuration.volume_group,
-                                      volume['name'])
+        volume_path = self.local_path(volume)
         export_info = self.target_driver.create_export(context,
                                                        volume,
                                                        volume_path)