← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1281904] [NEW] Wrong exception type HTTPBadRequest is raised

 

Public bug reported:

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.

** Affects: nova
     Importance: Undecided
     Assignee: Haiwei Xu (xu-haiwei)
         Status: In Progress

** Changed in: nova
     Assignee: (unassigned) => Haiwei Xu (xu-haiwei)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1281904

Title:
  Wrong exception type HTTPBadRequest is raised

Status in OpenStack Compute (Nova):
  In Progress

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1281904/+subscriptions


Follow ups

References