Fix upload volume to glance

We were missing the 'compress' parameter in the upload_volume method,
yet we were passing it on the driver, which meant that the call would
always fail with:

  TypeError: upload_volume() got an unexpected keyword argument
  'compress'

Related-Bug: #1824821
Closes-Bug: #1839069
Change-Id: Ibe9a0e78ab452c54cc3f1da1f4377034190dd14e
This commit is contained in:
Gorka Eguileor 2019-08-06 10:52:36 +02:00
parent b70c2237ef
commit 0a0d55d8a9
2 changed files with 3 additions and 3 deletions

View File

@ -84,7 +84,7 @@ QEMU_IMG_VERSION = None
QEMU_IMG_MIN_FORCE_SHARE_VERSION = [2, 10, 0]
QEMU_IMG_MIN_CONVERT_LUKS_VERSION = '2.10'
COMPRESSIBLE_IMAGE_FORMATS = ('qcow2')
COMPRESSIBLE_IMAGE_FORMATS = ('qcow2',)
def fixup_disk_format(disk_format):
@ -634,7 +634,7 @@ def _validate_file_format(image_data, expected_format):
def upload_volume(context, image_service, image_meta, volume_path,
volume_format='raw', run_as_root=True):
volume_format='raw', run_as_root=True, compress=True):
image_id = image_meta['id']
if (image_meta['disk_format'] == volume_format):
LOG.debug("%s was %s, no need to convert to %s",

View File

@ -747,7 +747,7 @@ class TestUploadVolume(test.TestCase):
temp_file = mock_temp.return_value.__enter__.return_value
output = image_utils.upload_volume(ctxt, image_service, image_meta,
volume_path)
volume_path, compress=True)
self.assertIsNone(output)
mock_convert.assert_called_once_with(volume_path,