Merge "Always upload image volumes in a native thread" into stable/2024.2
This commit is contained in:
@@ -1128,7 +1128,7 @@ def upload_volume(context: context.RequestContext,
|
|||||||
image_id, volume_format, image_meta['disk_format'])
|
image_id, volume_format, image_meta['disk_format'])
|
||||||
if volume_fd is not None:
|
if volume_fd is not None:
|
||||||
image_service.update(context, image_id, {},
|
image_service.update(context, image_id, {},
|
||||||
volume_fd,
|
tpool.Proxy(volume_fd),
|
||||||
store_id=store_id,
|
store_id=store_id,
|
||||||
base_image_ref=base_image_ref)
|
base_image_ref=base_image_ref)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -1037,9 +1037,9 @@ class TestUploadVolume(test.TestCase):
|
|||||||
self.assertFalse(mock_info.called)
|
self.assertFalse(mock_info.called)
|
||||||
mock_chown.assert_not_called()
|
mock_chown.assert_not_called()
|
||||||
mock_open.assert_not_called()
|
mock_open.assert_not_called()
|
||||||
mock_proxy.assert_not_called()
|
mock_proxy.assert_called_once_with(mock.sentinel.volume_fd)
|
||||||
image_service.update.assert_called_once_with(
|
image_service.update.assert_called_once_with(
|
||||||
ctxt, image_meta['id'], {}, mock.sentinel.volume_fd,
|
ctxt, image_meta['id'], {}, mock_proxy.return_value,
|
||||||
store_id=None, base_image_ref=None)
|
store_id=None, base_image_ref=None)
|
||||||
|
|
||||||
@mock.patch('cinder.image.accelerator.ImageAccel._get_engine')
|
@mock.patch('cinder.image.accelerator.ImageAccel._get_engine')
|
||||||
|
|||||||
Reference in New Issue
Block a user