← Back to team overview

registry team mailing list archive

[Bug 607541] [NEW] ObjectStore must throw 404 when bucket does not exist (Commit 146)

 

Public bug reported:

Before the twisted rewrite of the objectstore, if a bucket did not
exist, Bucket::__init__ would throw exception.NotFound(), and then the
@catch_nova_exceptions annotation would wrap that as a 404.  Now I think
the exception is not being caught, and it is simply being thrown as a
500.

The problem is that e.g. euca-upload-bundle checks to see if a bucket
should be created before upload by doing a GET on the bucket and looking
for a 404.  This logic now fails.

Essentially, the logic in catch_nova_exceptions has been lost.  I presume NotAuthorized is thrown somewhere also, and should also be caught and wrapped.
 
def catch_nova_exceptions(target):
     # FIXME: find a way to wrap all handlers in the web.Application.__init__ ?
     def wrapper(*args, **kwargs):
         try:
             return target(*args, **kwargs)
         except exception.NotFound:
             raise web.HTTPError(404)
         except exception.NotAuthorized:
             raise web.HTTPError(403)
  
     return wrapper

** Affects: nova
     Importance: Undecided
         Status: New

-- 
ObjectStore must throw 404 when bucket does not exist (Commit 146)
https://bugs.launchpad.net/bugs/607541
You received this bug notification because you are a member of Registry
Administrators, which is subscribed to OpenStack.



Follow ups

References