Increase test coverage for glance.common.wsgi

Add unit tests for wsgi.get_socket.

Change-Id: I3850dca6f6e4dbeca0465c8d751458e255e0fed8
Fix call to store.safe_delete_from_backend

When uploading data of a newly created image to a local filesystem
store, if the image data size exceeds the quota allocated to the user
then the operation fails with a "500 Internal Server Error".

This bug is triggered only when using chunked transfers to upload the
image data (curl and glanceclient both use chunked transfers).

When using chunked transfers the 'Content-Length' header is not set and
so the quota checking code in start of quota.ImageProxy.set_data() is
skipped. Furthermore, because of the missing size info, the store
downloads the entire image data without checking for the quota (the
quota is checked only after the image data has been downloaded and the
size determined).

If after the image data has been downloaded it is found that the quota
has been exceeded, then the StorageQuotaFull exception is raised and a
call to store.safe_delete_from_backend() made to clean up the image
data. But the 'location' and 'context' parameters to this call are given
in the wrong order and so this operation raises an (uncaught) exception,
giving rise to this bug.

This bug was not caught by existing tests because existing quota tests
don't use chunked transfer.

This commit fixes the order of the parameters and adds quota tests using
chunked transfers.

Change-Id: Ib8ab11f2115e3aead98af70788eaa45c2c33219c
Closes-bug: #1265446
Sync Log levels from OSLO

Copy changes from just 1 commit:
I0736fd62190fd0b3b26133916f8b3d4d9f0499c2 Default iso8601 logging to warn

Change-Id: I1c90705d4d9b37e5472eeebce0192d4d7aa1febe
Merge "Sync Log levels from OSLO"
Merge "Fix call to store.safe_delete_from_backend"
Merge "Increase test coverage for glance.common.wsgi"