create/update of v3 servers return 422 when input is invalid

Bug #1251538 reported by Alex Xu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Alex Xu

Bug Description

In v3 servers core api, create and update will return 422 when input is invalid.

if not self.is_valid_body(body, 'server'):
            raise exc.HTTPUnprocessableEntity()

We prefer use 400 for this case in v3 api.

Tags: api
Revision history for this message
Matt Riedemann (mriedem) wrote :

It's the same way in the v2 API. There are other APIs doing the same thing too. Maybe a discussion for nova on the dev mailing list?

tags: added: api
Changed in nova:
status: New → Opinion
Revision history for this message
Christopher Yeoh (cyeoh-0) wrote :

We have been fixing this in the V2 API for a while as well because 422 is a WebDav error code. I unfortunately can not find the original discussion around this.

Revision history for this message
Mark McLoughlin (markmc) wrote :
Changed in nova:
status: Opinion → In Progress
importance: Undecided → Low
assignee: nobody → Alex Xu (xuhj)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/56532
Committed: http://github.com/openstack/nova/commit/3cdc0799fd0ab22bc4a83df8157adbbc72bcfa53
Submitter: Jenkins
Branch: master

commit 3cdc0799fd0ab22bc4a83df8157adbbc72bcfa53
Author: He Jie Xu <email address hidden>
Date: Fri Nov 15 13:52:51 2013 +0800

    Use 400 instead of 422 for invalid input in v3 servers core

    We return 400 when input is invalid for v3 api. This patch fix
    this case for servers core.

    DocImpact

    Change-Id: If802d4dcba6ed25f7e9cb9d568a3ffd78f0f6c68
    Closes-Bug: 1251538

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-2
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-2 → 2014.1
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.