Wrong exception type HTTPBadRequest is raised

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

Bug Description

When user without admin permission wants to get a list of servers
which are in 'deleted' state, currently it raises HTTPBadRequest.

The code is:

 231 if search_opts.get("vm_state") == ['deleted']:
 232 if context.is_admin:
 233 search_opts['deleted'] = True
 234 else:
 235 msg = _("Only administrators may list deleted instances")
 236 raise exc.HTTPBadRequest(explanation=msg)

This should be changed to HTTPForbidden exception.

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

Reviewed: https://review.openstack.org/74552
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=544745f9da3245a71d771cff26dc6d0255bb0470
Submitter: Jenkins
Branch: master

commit 544745f9da3245a71d771cff26dc6d0255bb0470
Author: Haiwei Xu <email address hidden>
Date: Wed Feb 19 04:32:38 2014 +0900

    Change exception type from HTTPBadRequest to HTTPForbidden

    When user without admin permission wants to get a list of servers
    which are in 'deleted' state, currently it raises HTTPBadRequest.
    This should be changed to HTTPForbidden exception.

    Change-Id: I29da5f055c69e8aba66ffb068a3601ae69b2fc94
    Closes-Bug: #1281904

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