Not able to upload volume to image
upload_to_image() function should be updated when client version is bigger than 3.1. Without this we are not able to run this function: image = cinder_client.volumes.upload_to_image( volume=temporary_volume, force=True, image_name='temporary_image_of_{0}'.format(temporary_volume.id), container_format="bare", disk_format="raw" ) Change-Id: I825ad0d6f6c25e2d85c756e6148e73e7e298ef75 Closes-Bug: #1787399 Co-Authored-By: Jiao Pengju <jiaopengju@cmss.chinamobile.com>
This commit is contained in:
parent
ed23bc9551
commit
089f9886b0
|
@ -170,7 +170,9 @@ class ProtectOperation(protection_plugin.Operation):
|
||||||
force=True,
|
force=True,
|
||||||
image_name='temporary_image_of_{0}'.format(temporary_volume.id),
|
image_name='temporary_image_of_{0}'.format(temporary_volume.id),
|
||||||
container_format="bare",
|
container_format="bare",
|
||||||
disk_format="raw"
|
disk_format="raw",
|
||||||
|
visibility="private",
|
||||||
|
protected=False
|
||||||
)
|
)
|
||||||
image_id = image[1]['os-volume_upload_image']['image_id']
|
image_id = image[1]['os-volume_upload_image']['image_id']
|
||||||
is_success = utils.status_poll(
|
is_success = utils.status_poll(
|
||||||
|
|
|
@ -211,6 +211,15 @@ class VolumeGlanceProtectionPluginTest(base.TestCase):
|
||||||
|
|
||||||
call_hooks(protect_operation, self.checkpoint, resource, self.cntxt,
|
call_hooks(protect_operation, self.checkpoint, resource, self.cntxt,
|
||||||
{})
|
{})
|
||||||
|
self.cinder_client.volumes.upload_to_image.assert_called_with(
|
||||||
|
volume=Volume(id='2345', status='available', size=1),
|
||||||
|
force=True,
|
||||||
|
image_name='temporary_image_of_2345',
|
||||||
|
container_format="bare",
|
||||||
|
disk_format="raw",
|
||||||
|
visibility="private",
|
||||||
|
protected=False
|
||||||
|
)
|
||||||
|
|
||||||
def test_delete_backup(self):
|
def test_delete_backup(self):
|
||||||
resource = Resource(id="123",
|
resource = Resource(id="123",
|
||||||
|
|
Loading…
Reference in New Issue