]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Ensures NetApp iSCSI driver correctly compares int values for size
authorAndrew Kerr <andrew.kerr@netapp.com>
Tue, 18 Feb 2014 22:38:12 +0000 (17:38 -0500)
committerAndrew Kerr <andrew.kerr@netapp.com>
Tue, 18 Feb 2014 22:49:47 +0000 (17:49 -0500)
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

cinder/volume/drivers/netapp/iscsi.py

index a8c18996b3a071ca9a217ec6244b2880a651a720..a8710ce2c8534f56815b20120fed5158ff653158 100644 (file)
@@ -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)