← Back to team overview

registry team mailing list archive

[Bug 608386] [NEW] Bucket.delete() throws NotAuthorized exception when Bucket is not empty

 

Public bug reported:

Doing some cleanup in the objectstore_unittest.py file, I noticed that
the test case was papering over the actual exception type by just
checking for the existence of an exception.  For instance:

        # deleting non-empty bucket throws exception
        exception = False
        try:
            bucket.delete()
        except:
            exception = True

        self.assert_(exception)

This helps the test case pass, but unfortunately covers up some bad
behaviour, like the fact that bucket.delete() actually throws a
misleading NotAuthorized exception instead of, for example, a NotEmpty
exception...

Fix for this bug is to clean up the test case to properly use
self.assertRaises() and to modify Bucket.delete() to throw a NotEmpty
exception.

** Affects: nova
     Importance: Low
     Assignee: Jay Pipes (jaypipes)
         Status: New


** Tags: tests

-- 
Bucket.delete() throws NotAuthorized exception when Bucket is not empty
https://bugs.launchpad.net/bugs/608386
You received this bug notification because you are a member of Registry
Administrators, which is subscribed to OpenStack.



Follow ups

References