clean up numeric expressions in test

Replace numeric expressions with constants in tests
to make code more readable.

Change-Id: I42469cdbe3cafd36f8d9855c8284f885ffa7f465
This commit is contained in:
Chang Bo Guo
2013-10-29 02:03:50 -07:00
parent 75bcf70ed4
commit f709c9d3db
13 changed files with 25 additions and 19 deletions

View File

@@ -44,6 +44,7 @@ from cinder.backup.driver import BackupDriver
from cinder import exception
from cinder.openstack.common import log as logging
from cinder.openstack.common import timeutils
from cinder import units
from swiftclient import client as swift
@@ -242,7 +243,7 @@ class SwiftBackupDriver(BackupDriver):
backup['service_metadata'] = object_prefix
self.db.backup_update(self.context, backup_id, {'service_metadata':
object_prefix})
volume_size_bytes = volume['size'] * 1024 * 1024 * 1024
volume_size_bytes = volume['size'] * units.GiB
availability_zone = self.az
LOG.debug(_('starting backup of volume: %(volume_id)s to swift,'
' volume size: %(volume_size_bytes)d, swift object names'