webob.exc.HTTPUnprocessableEntity can't return correct messages

Bug #1283876 reported by Haiwei Xu
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Haiwei Xu

Bug Description

In nova/api/openstack/compute/contrib/services.py there are codes like:

190 if id == "disable-log-reason":
191 reason = body['disabled_reason']
192 if not self._is_valid_as_reason(reason):
193 msg = _('The string containing the reason for disabling '
194 'the service contains invalid characters or is '
195 'too long.')
196 raise webob.exc.HTTPUnprocessableEntity(detail=msg)

But HTTPUnprocessableEntity should use 'explanation' parameter to return the error message.

The source can be referred here:

https://github.com/Pylons/webob/blob/master/webob/exc.py#L885

Haiwei Xu (xu-haiwei)
Changed in nova:
assignee: nobody → Haiwei Xu (xu-haiwei)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/75736
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=7eb42f18ce8574b28ecba16b478bcfc40dfa2005
Submitter: Jenkins
Branch: master

commit 7eb42f18ce8574b28ecba16b478bcfc40dfa2005
Author: Haiwei Xu <email address hidden>
Date: Mon Feb 24 19:30:43 2014 +0900

    Change HTTPUnprocessableEntity to HTTPBadRequest

    Change HTTPUnprocessableEntity to HTTPBadRequest, and use the
    parameter 'explanation' in place of'detail' to show the correct
    error message.
    This patch fixes this bug.

    Change-Id: I6dc2cbe29f24634138ba4c5255b0edd7b8ad6b0e
    Closes-Bug: #1283876

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-1 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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