From a61b9678f1abdd14964581cd49e7a25a7635749e Mon Sep 17 00:00:00 2001 From: Flavio Percoco Date: Thu, 5 Dec 2013 16:14:39 +0100 Subject: [PATCH] Convert lvm_mirrors to int When the location_info is parsed and `lvm_mirrors` extracted, it is not being converted to int. This causes some boolean checks to return True even when there are not mirrors enabled because of the u'0'. Closes-bug: #1258133 (cherry picked from commit 1dff30492f0ce1df3ef01ccc21353248a7207709) Change-Id: I67c463d9f139fe326bbcab4d193c45459129b514 --- cinder/volume/drivers/lvm.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cinder/volume/drivers/lvm.py b/cinder/volume/drivers/lvm.py index c5c4d642df4..2352f58c937 100644 --- a/cinder/volume/drivers/lvm.py +++ b/cinder/volume/drivers/lvm.py @@ -697,6 +697,7 @@ class LVMISCSIDriver(LVMVolumeDriver, driver.ISCSIDriver): try: (dest_type, dest_hostname, dest_vg, lvm_type, lvm_mirrors) =\ info.split(':') + lvm_mirrors = int(lvm_mirrors) except ValueError: return false_ret if (dest_type != 'LVMVolumeDriver' or dest_hostname != self.hostname):