From: Andrew Kerr Date: Tue, 18 Feb 2014 22:38:12 +0000 (-0500) Subject: Ensures NetApp iSCSI driver correctly compares int values for size X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=a1d78df1b7c95dbb5024023662932cd94313dd58;p=openstack-build%2Fcinder-build.git Ensures NetApp iSCSI driver correctly compares int values for size The NetApp iSCSI driver needs to verify that the new size requested during an extend operation does not exceed the max_resize of the lun. However, the driver was doing a >= compare against str values of the sizes rather than the int values. This caused the incorrect code path to be used in certain situations. Change-Id: I8bc66c71db6b469c7adf00ce8b5091513fccb740 Closes-Bug: 1281279 --- diff --git a/cinder/volume/drivers/netapp/iscsi.py b/cinder/volume/drivers/netapp/iscsi.py index a8c18996b..a8710ce2c 100644 --- a/cinder/volume/drivers/netapp/iscsi.py +++ b/cinder/volume/drivers/netapp/iscsi.py @@ -591,7 +591,8 @@ class NetAppDirectISCSIDriver(driver.ISCSIDriver): if curr_size_bytes != new_size_bytes: lun_geometry = self._get_lun_geometry(path) if (lun_geometry and lun_geometry.get("max_resize") - and lun_geometry.get("max_resize") >= new_size_bytes): + and int(lun_geometry.get("max_resize")) >= + int(new_size_bytes)): self._do_direct_resize(path, new_size_bytes) else: self._do_sub_clone_resize(path, new_size_bytes)