_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
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