diff --git a/cinder/tests/test_hp3par.py b/cinder/tests/test_hp3par.py index 820a880ae36..f015b73543b 100644 --- a/cinder/tests/test_hp3par.py +++ b/cinder/tests/test_hp3par.py @@ -24,6 +24,7 @@ from cinder import context from cinder import exception from cinder.openstack.common import log as logging from cinder import test +from cinder import units from cinder.volume.drivers.san.hp import hp_3par_fc as hpfcdriver from cinder.volume.drivers.san.hp import hp_3par_iscsi as hpdriver from cinder.volume import qos_specs @@ -773,9 +774,10 @@ class HP3PARBaseDriver(object): old_size = self.volume['size'] new_size = old_size + grow_size self.driver.extend_volume(self.volume, str(new_size)) + growth_size_mib = grow_size * units.KiB expected = [ - mock.call.growVolume(self.VOLUME_3PAR_NAME, grow_size)] + mock.call.growVolume(self.VOLUME_3PAR_NAME, growth_size_mib)] mock_client.assert_has_calls(expected) diff --git a/cinder/volume/drivers/san/hp/hp_3par_common.py b/cinder/volume/drivers/san/hp/hp_3par_common.py index 8bb6b434fe8..f3fb0bde867 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_common.py +++ b/cinder/volume/drivers/san/hp/hp_3par_common.py @@ -118,10 +118,11 @@ class HP3PARCommon(object): 2.0.2 - Add back-end assisted volume migrate 2.0.3 - Allow deleting missing snapshots bug #1283233 2.0.4 - Allow volumes created from snapshots to be larger bug #1279478 + 2.0.5 - Fix extend volume units bug #1284368 """ - VERSION = "2.0.4" + VERSION = "2.0.5" stats = {} @@ -248,8 +249,9 @@ class HP3PARCommon(object): growth_size = int(new_size) - old_size LOG.debug("Extending Volume %s from %s to %s, by %s GB." % (volume_name, old_size, new_size, growth_size)) + growth_size_mib = growth_size * units.KiB try: - self.client.growVolume(volume_name, growth_size) + self.client.growVolume(volume_name, growth_size_mib) except Exception: with excutils.save_and_reraise_exception(): LOG.error(_("Error extending volume %s") % volume)