Fix quarantine, error counts in audit logs

Any quarantines and errors that happened between the last recon dump
and the end of an audit pass weren't getting counted in the logs.

This is particularly easy to see on a mostly-empty SAIO: go corrupt a
file, and the auditor will probably tell you (a) that it's
quarantining a file, and then (b) that 0 files were quarantined.

Change-Id: I78e32b911e457078144564e3be42527260148ade
Fix test to work with mock 0.8.0

This particular test case used a construct that worked in mock 1.0,
but not in 0.8. Our test-requirements.txt says mock>=0.8.0.

Change-Id: I93ed4b7b5d169572bbed6490cb9b0dd421a3b9e2
Fix UnboundLocalError on container PUT

Fixes bug-1243973

Change-Id: If165fdcccb5d4712570b1cdabcc89e618f539849
Use POST in bulk-delete

The DELETE verb applies to a single resource, and doesn't define any
semantics for the body.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.7

The swift Bulk Delete command affects multiple resources specified in a
DELETE body.

http://docs.openstack.org/developer/swift/misc.html#module-swift.common.middleware.bulk

While Bulk Delete is a welcome operation, its usage of DELETE is
unusual: affecting multiple resources and relying on reading content.

More typically, such an operation employs POST (or PUT), which folks
including api-craft usually agree is the best "catch-all" verb for
behaviors such as those affecting multiple resources. That's the TL;DR;
of the thread below.

https://groups.google.com/forum/#!searchin/api-craft/Regarding$20Bulk$20actions/api-craft/wY-W1NdZDRs/7YDwMhCR608J

Note that this topic isn't nasal or abstract. The current behavior is
unsupported using the built-in java http client. Even if third-party
libraries can work around this behavior, it is probably best to not be a
snowflake wrt http verb semantics where possible!

http://stackoverflow.com/questions/9100776/http-delete-with-request-body-issues

DocImpact

Closes-Bug: #1232787
Change-Id: I0fc74c85618fe4dd7ff5e7f9756c7f6f67aa0465
Import filter and app into namespace correctly

The module used to simply "import swift", and then reference
the classes:

    swift.common.middleware.catch_errors.CatchErrorsMiddleware
    swift.proxy.server.Application

in order to very that the WSGI services loaded the proper filters and
apps.

However, those references only happen to work, as the WSGI loading
would properly import the rest of the path so that the namespace
reference would be okay. If the WSGI configuration were to change, or
if the behavior of WSGI broke, instead of of seeing the actual failure
condition, a module attribute error would result instead:

    AttributeError: 'module' object has no attribute 'middleware'

The referenced names are now properly imported with this change to
avoid misleading error conditions.

Change-Id: Ifff4271bc5be1136bf17e4e5b291b01033d608db
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Merge "Fix quarantine, error counts in audit logs"
Merge "Fix UnboundLocalError on container PUT"
Merge "Fix test to work with mock 0.8.0"
Do not format messages before they are logged

Change-Id: Ia645c9eca47b7f404d9b987f68a96b4744031e9d
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Merge "Import filter and app into namespace correctly"
Merge "Use POST in bulk-delete"
Merge "Do not format messages before they are logged"