metadata and group_specs should allow null.

Bug #1742938 reported by Neha Alhat
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Neha Alhat

Bug Description

On current master for snapshot_manage create API, if user passes
metadata as null then it is giving 400 Bad Request. But before the
schema validation done in patch[1] metadata as null is accepted.

For group_type create API, group_specs as null is accepted before
merging patch[2]. but on current master it is giving 400 Bad Request.

[1] https://review.openstack.org/#/c/528631/
[2] https://review.openstack.org/#/c/519643/

Steps to reproduce:

1. curl -g -i -X POST http://10.232.48.198/volume/v3/5fe3b884c656498b922d8551c86cb0b0/manageable_snapshots -H "X-Auth-Token: a2ffd78a91224d369b1e5cb71ac705b1" -H "OpenStack-API-Version: volume 3.8" -H "X-OpenStack-Cinder-API-Version: 3.8" -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-cinderclient" -d '{"snapshot": {"ref": {"source-name": "lvol0"}, "volume_id": "daf9e961-d6dd-41f8-9cb6-4bba0fce8a1c", "description": "test", "metadata": null}}'

output:

400 Bad Request

{"badRequest": {"code": 400, "message": "Invalid input for field/attribute metadata. Value: None. None is not of type 'object'"}}

2. curl -g -i -X POST http://10.232.48.206/volume/v3/63759ee0b57249539af42d95a58032df/group_types -H "OpenStack-API-Version: volume 3.13" -H "X-OpenStack-Cinder-API-Version: 3.13" -H "User-Agent: python-cinderclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: b63eeb8e10d74933a4d03debbb2220b7" -d '{"group_type": {"name": "test3", "description": "test_desc", "group_specs": null}}'

output:

400 Bad Request

{"badRequest": {"message": "Invalid input for field/attribute group_specs. Value: None. None is not of type 'object'", "code": 400}}

Neha Alhat (nehaalhat)
Changed in cinder:
assignee: nobody → Neha Alhat (nehaalhat)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/533595

Changed in cinder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/533595
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=cc185a00e6455ddc3a494e4bc8ec377aed836feb
Submitter: Zuul
Branch: master

commit cc185a00e6455ddc3a494e4bc8ec377aed836feb
Author: Neha Alhat <email address hidden>
Date: Sun Jan 14 12:46:38 2018 +0530

    Fix BadRequest for 'null' metadata and group_specs

    Before schema validation patches [1] and [2] merged, it was allowed
    to pass metadata and group_specs as null but with these patches 400
    BadRequest is returned to user.

    This patch fixes this issue by allowing group_specs and metadata to
    be null in request_body.

    [1] https://review.openstack.org/#/c/528631/
    [2] https://review.openstack.org/#/c/519643/

    Change-Id: If207877811a5c331c28fc853cf233758a1743903
    Closes-Bug: #1742938

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 12.0.0.0b3

This issue was fixed in the openstack/cinder 12.0.0.0b3 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.