summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-10-16 01:41:57 +0000
committerGerrit Code Review <review@openstack.org>2018-10-16 01:41:57 +0000
commit4ec11e181e78295beb3e7a21da7c013bef0532f3 (patch)
treefcf506b690597d85e1b67cce4b043a09ac469d29
parent928b0b0bfeecfb1c884c34eb8773c3294b97436b (diff)
parent089f9886b0c08156f5afe37e37bc3744a21d062d (diff)
Merge "Not able to upload volume to image"
-rw-r--r--karbor/services/protection/protection_plugins/volume/volume_glance_plugin.py4
-rw-r--r--karbor/tests/unit/protection/test_cinder_glance_plugin.py9
2 files changed, 12 insertions, 1 deletions
diff --git a/karbor/services/protection/protection_plugins/volume/volume_glance_plugin.py b/karbor/services/protection/protection_plugins/volume/volume_glance_plugin.py
index f04d486..773a1e5 100644
--- a/karbor/services/protection/protection_plugins/volume/volume_glance_plugin.py
+++ b/karbor/services/protection/protection_plugins/volume/volume_glance_plugin.py
@@ -170,7 +170,9 @@ class ProtectOperation(protection_plugin.Operation):
170 force=True, 170 force=True,
171 image_name='temporary_image_of_{0}'.format(temporary_volume.id), 171 image_name='temporary_image_of_{0}'.format(temporary_volume.id),
172 container_format="bare", 172 container_format="bare",
173 disk_format="raw" 173 disk_format="raw",
174 visibility="private",
175 protected=False
174 ) 176 )
175 image_id = image[1]['os-volume_upload_image']['image_id'] 177 image_id = image[1]['os-volume_upload_image']['image_id']
176 is_success = utils.status_poll( 178 is_success = utils.status_poll(
diff --git a/karbor/tests/unit/protection/test_cinder_glance_plugin.py b/karbor/tests/unit/protection/test_cinder_glance_plugin.py
index 433ea6a..b3613b6 100644
--- a/karbor/tests/unit/protection/test_cinder_glance_plugin.py
+++ b/karbor/tests/unit/protection/test_cinder_glance_plugin.py
@@ -211,6 +211,15 @@ class VolumeGlanceProtectionPluginTest(base.TestCase):
211 211
212 call_hooks(protect_operation, self.checkpoint, resource, self.cntxt, 212 call_hooks(protect_operation, self.checkpoint, resource, self.cntxt,
213 {}) 213 {})
214 self.cinder_client.volumes.upload_to_image.assert_called_with(
215 volume=Volume(id='2345', status='available', size=1),
216 force=True,
217 image_name='temporary_image_of_2345',
218 container_format="bare",
219 disk_format="raw",
220 visibility="private",
221 protected=False
222 )
214 223
215 def test_delete_backup(self): 224 def test_delete_backup(self):
216 resource = Resource(id="123", 225 resource = Resource(id="123",