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
(cherry picked from commit a1d78df1b7)
This commit is contained in:
Andrew Kerr 2014-02-18 17:38:12 -05:00 committed by Dirk Mueller
parent ab12130994
commit 78d7e7ace7
1 changed files with 2 additions and 1 deletions

View File

@ -603,7 +603,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)