From e21a5d3245a92a92f569a4f2781678da49c340d0 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 1 Oct 2015 18:15:54 +0200 Subject: [PATCH] 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 --- cinder/volume/drivers/emc/emc_vmax_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 -- 2.45.2