Remove unnecessary parameters on create_volume API
Current Tempest client passes a null value to Nova's create_volume
API if tests don't specify description_name and metadata attributes.
However, that is wrong behavior because these attributes are optional
and Tempest doesn't need to specify them instead of specifying null
values. This behaivor will be a problem because Nova v2.1 API doesn't
allow this kind of values by strict input validation.
This patch makes create_volume API client skip passing null values
in this case.
Change-Id: I16249afeb254dfce1c4b155e2e3746500f6a9ea5
diff --git a/tempest/services/compute/json/volumes_extensions_client.py b/tempest/services/compute/json/volumes_extensions_client.py
index 309dc5b..6b27f4a 100644
--- a/tempest/services/compute/json/volumes_extensions_client.py
+++ b/tempest/services/compute/json/volumes_extensions_client.py
@@ -73,10 +73,9 @@
metadata: A dictionary of values to be used as metadata.
"""
post_body = {
- 'size': size,
- 'display_name': kwargs.get('display_name'),
- 'metadata': kwargs.get('metadata'),
+ 'size': size
}
+ post_body.update(kwargs)
post_body = json.dumps({'volume': post_body})
resp, body = self.post('os-volumes', post_body)