Merge "Replace 1024*1024*1024 with units.Gi to express more accurately"

This commit is contained in:
Jenkins 2016-06-26 15:50:24 +00:00 committed by Gerrit Code Review
commit 25fc3485a6

View File

@ -21,6 +21,7 @@ from xml.dom import minidom
from oslo_log import log as logging from oslo_log import log as logging
from oslo_service import loopingcall from oslo_service import loopingcall
from oslo_utils import units
import six import six
from cinder import context from cinder import context
@ -744,7 +745,7 @@ class EMCVMAXUtils(object):
:param strGB: string -- The size in GB :param strGB: string -- The size in GB
:returns: string -- The size in bytes :returns: string -- The size in bytes
""" """
strBitsSize = six.text_type(int(strGbSize) * 1024 * 1024 * 1024) strBitsSize = six.text_type(int(strGbSize) * units.Gi)
LOG.debug("Converted %(strGbSize)s GBs to %(strBitsSize)s Bits.", LOG.debug("Converted %(strGbSize)s GBs to %(strBitsSize)s Bits.",
{'strGbSize': strGbSize, 'strBitsSize': strBitsSize}) {'strGbSize': strGbSize, 'strBitsSize': strBitsSize})