]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Only use iscsi_helper config option if using LVMISCSIDriver
authorEric Harney <eharney@redhat.com>
Fri, 22 Feb 2013 16:27:29 +0000 (11:27 -0500)
committerEric Harney <eharney@redhat.com>
Wed, 27 Feb 2013 20:26:26 +0000 (15:26 -0500)
_get_iscsi_properties checks for iscsi_helper == 'tgtadm',
but this is run for drivers other than LVMISCSIDriver.

Only change target_lun based on iscsi_helper if using
LVMISCSIDriver/ThinLVMVolumeDriver.

Change-Id: I8c63f8d4097682c875bbfdfade665fdacbcf8e22

cinder/volume/driver.py

index 183d6c8f64fc24ef31be64a37ae1b575336efb65..4ee0a1920c2ea5d2e016119b4372004f0be7d24e 100644 (file)
@@ -277,7 +277,10 @@ class ISCSIDriver(VolumeDriver):
         try:
             properties['target_lun'] = int(results[2])
         except (IndexError, ValueError):
-            if self.configuration.iscsi_helper == 'tgtadm':
+            if (self.configuration.volume_driver in
+                    ['cinder.volume.drivers.lvm.LVMISCSIDriver',
+                     'cinder.volume.drivers.lvm.ThinLVMVolumeDriver'] and
+                    self.configuration.iscsi_helper == 'tgtadm'):
                 properties['target_lun'] = 1
             else:
                 properties['target_lun'] = 0