summaryrefslogtreecommitdiff
path: root/cinderclient/v2/volumes.py
diff options
context:
space:
mode:
authorNeha Alhat <neha.alhat@nttdata.com>2018-06-07 18:22:16 +0530
committerSean McGinnis <sean.mcginnis@gmail.com>2018-07-26 11:29:08 -0500
commit8d566689001a442c2312e366acc167af88888fd3 (patch)
tree343193bb65fb86b99bb827fd9e7a7c05e3a6918b /cinderclient/v2/volumes.py
parent0f56085c0286a022c31258689d9a416f77979d90 (diff)
downloadpython-cinderclient-8d566689001a442c2312e366acc167af88888fd3.tar.gz
Remove unnecessary parameters from volume create APIs
As per Cinder code, following parameters are not required to be passed in the request body of create volume API. * status * user_id * attach_status * project_id * source_replica If you pass these parameters, previously it was ignored but in the schema validation changes[1] we don't allow additionalProperties to be passed in the request body. If user passes additional parameters which are not as per API specs[2], then it will be rejected with 400 error. On patch[3], tempest tests: test_volume_snapshot_create_get_list_delete, test_volume_create_get_delete" are failing because of these unnecessary parameters. This patch removes these unnecessary parameters passed to the create Volume API. [1]https://blueprints.launchpad.net/cinder/+spec/json-schema-validation [2]https://review.openstack.org/#/c/507386/ [3]https://review.openstack.org/#/c/573093/ Change-Id: I37744bfd0b0bc59682c3e680c1200f608ad3991b
Diffstat (limited to 'cinderclient/v2/volumes.py')
-rw-r--r--cinderclient/v2/volumes.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/cinderclient/v2/volumes.py b/cinderclient/v2/volumes.py
index 53229ab..d8365df 100644
--- a/cinderclient/v2/volumes.py
+++ b/cinderclient/v2/volumes.py
@@ -251,8 +251,8 @@ class VolumeManager(base.ManagerWithFind):
:param name: Name of the volume
:param description: Description of the volume
:param volume_type: Type of volume
- :param user_id: User id derived from context
- :param project_id: Project id derived from context
+ :param user_id: User id derived from context (IGNORED)
+ :param project_id: Project id derived from context (IGNORED)
:param availability_zone: Availability Zone to use
:param metadata: Optional metadata to set on volume creation
:param imageRef: reference to an image stored in glance
@@ -282,15 +282,10 @@ class VolumeManager(base.ManagerWithFind):
'name': name,
'description': description,
'volume_type': volume_type,
- 'user_id': user_id,
- 'project_id': project_id,
'availability_zone': availability_zone,
- 'status': "creating",
- 'attach_status': "detached",
'metadata': volume_metadata,
'imageRef': imageRef,
'source_volid': source_volid,
- 'source_replica': source_replica,
'multiattach': multiattach,
}}