diff options
| author | Neha Alhat <neha.alhat@nttdata.com> | 2018-06-07 18:22:16 +0530 |
|---|---|---|
| committer | Sean McGinnis <sean.mcginnis@gmail.com> | 2018-07-26 11:29:08 -0500 |
| commit | 8d566689001a442c2312e366acc167af88888fd3 (patch) | |
| tree | 343193bb65fb86b99bb827fd9e7a7c05e3a6918b /cinderclient/tests/unit/v3 | |
| parent | 0f56085c0286a022c31258689d9a416f77979d90 (diff) | |
| download | python-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/tests/unit/v3')
| -rw-r--r-- | cinderclient/tests/unit/v3/test_shell.py | 10 | ||||
| -rw-r--r-- | cinderclient/tests/unit/v3/test_volumes.py | 7 |
2 files changed, 1 insertions, 16 deletions
diff --git a/cinderclient/tests/unit/v3/test_shell.py b/cinderclient/tests/unit/v3/test_shell.py index 1811397..e06dedc 100644 --- a/cinderclient/tests/unit/v3/test_shell.py +++ b/cinderclient/tests/unit/v3/test_shell.py @@ -592,13 +592,8 @@ class ShellTest(utils.TestCase): '--volume-type 4321 1') self.assert_called('GET', '/volumes/1234') expected = {'volume': {'imageRef': None, - 'project_id': None, - 'status': 'creating', 'size': 1, - 'user_id': None, 'availability_zone': None, - 'source_replica': None, - 'attach_status': 'detached', 'source_volid': None, 'consistencygroup_id': None, 'group_id': '5678', @@ -621,13 +616,8 @@ class ShellTest(utils.TestCase): self.run_command(cmd) self.assert_called('GET', '/volumes/1234') expected = {'volume': {'imageRef': None, - 'project_id': None, - 'status': 'creating', - 'user_id': None, 'size': None, 'availability_zone': None, - 'source_replica': None, - 'attach_status': 'detached', 'source_volid': None, 'consistencygroup_id': None, 'name': None, diff --git a/cinderclient/tests/unit/v3/test_volumes.py b/cinderclient/tests/unit/v3/test_volumes.py index b7b1c12..42e649b 100644 --- a/cinderclient/tests/unit/v3/test_volumes.py +++ b/cinderclient/tests/unit/v3/test_volumes.py @@ -73,20 +73,15 @@ class VolumesTest(utils.TestCase): def test_create_volume(self): cs = fakes.FakeClient(api_versions.APIVersion('3.13')) vol = cs.volumes.create(1, group_id='1234', volume_type='5678') - expected = {'volume': {'status': 'creating', - 'description': None, + expected = {'volume': {'description': None, 'availability_zone': None, 'source_volid': None, 'snapshot_id': None, 'size': 1, - 'user_id': None, 'name': None, 'imageRef': None, - 'attach_status': 'detached', 'volume_type': '5678', - 'project_id': None, 'metadata': {}, - 'source_replica': None, 'consistencygroup_id': None, 'multiattach': False, 'group_id': '1234', |
