Adds disk_format parameter to upload_volume method in volumes client
Adds a third parameter, disk_format, to the upload_volume method of
the volumes client. The parameter is also added to the Tempest
configuration and defaults to "raw" if not set.
Closes-Bug: #1218666
Change-Id: I6c62796161c9219cbd80eb9fecc7fbb0f3a4681a
diff --git a/tempest/services/volume/json/volumes_client.py b/tempest/services/volume/json/volumes_client.py
index 2ae73b1..c35452e 100644
--- a/tempest/services/volume/json/volumes_client.py
+++ b/tempest/services/volume/json/volumes_client.py
@@ -89,10 +89,11 @@
"""Deletes the Specified Volume."""
return self.delete("volumes/%s" % str(volume_id))
- def upload_volume(self, volume_id, image_name):
+ def upload_volume(self, volume_id, image_name, disk_format):
"""Uploads a volume in Glance."""
post_body = {
'image_name': image_name,
+ 'disk_format': disk_format
}
post_body = json.dumps({'os-volume_upload_image': post_body})
url = 'volumes/%s/action' % (volume_id)