]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Convert lvm_mirrors to int
authorFlavio Percoco <flaper87@gmail.com>
Thu, 5 Dec 2013 15:14:39 +0000 (16:14 +0100)
committerFlavio Percoco <flaper87@gmail.com>
Thu, 5 Dec 2013 22:26:46 +0000 (23:26 +0100)
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
Change-Id: I67c463d9f139fe326bbcab4d193c45459129b514

cinder/volume/drivers/lvm.py

index 187d052151a793be12563f4fc311574085e9a3a9..40aa62e8698753b792a6894342b6755df331a9c1 100644 (file)
@@ -692,6 +692,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):