From: Victor Stinner Date: Thu, 1 Oct 2015 16:15:54 +0000 (+0200) Subject: emc vmax driver: use integer division for Python 3 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=e21a5d3245a92a92f569a4f2781678da49c340d0;p=openstack-build%2Fcinder-build.git emc vmax driver: use integer division for Python 3 Replace a/b with a//b in emc_vmax_utils.py to get integers on Python 3. Blueprint cinder-python3 Change-Id: I8d9390b1558e2b4a08674eadcaa3559020f8dcff --- diff --git a/cinder/volume/drivers/emc/emc_vmax_utils.py b/cinder/volume/drivers/emc/emc_vmax_utils.py index f29809ce6..c5e42822b 100644 --- a/cinder/volume/drivers/emc/emc_vmax_utils.py +++ b/cinder/volume/drivers/emc/emc_vmax_utils.py @@ -912,7 +912,7 @@ class EMCVMAXUtils(object): """ errorDesc = None if compositeType in 'concatenated' and int(sizeStr) > 240: - newMemberCount = int(sizeStr) / 240 + newMemberCount = int(sizeStr) // 240 modular = int(sizeStr) % 240 if modular > 0: newMemberCount += 1 @@ -1012,7 +1012,7 @@ class EMCVMAXUtils(object): :param strBitSize: string -- The size in bytes :returns: int -- The size in GB """ - gbSize = int(strBitSize) / 1024 / 1024 / 1024 + gbSize = int(strBitSize) // 1024 // 1024 // 1024 return gbSize def compare_size(self, size1Str, size2Str): @@ -1154,8 +1154,8 @@ class EMCVMAXUtils(object): :returns: string -- truncated string or original string """ if len(strToTruncate) > maxNum: - newNum = len(strToTruncate) - maxNum / 2 - firstChars = strToTruncate[:maxNum / 2] + newNum = len(strToTruncate) - maxNum // 2 + firstChars = strToTruncate[:maxNum // 2] lastChars = strToTruncate[newNum:] strToTruncate = firstChars + lastChars