Fixes content-type checking for image uploading in API v1 and v2

wsgi.Request.get_content_type() need a list or set for
allowed_content_types as parameter, but API controller passes request's
content type as a string into it directly. This caused 'in' testing
failure.

Fixes bug: 1241387

Change-Id: I820ccce92e4ec1c94b5144309d6ebe2b57baaf55
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Add tests for glance/image_cache/client.py

- add test cases for all CacheClient's functions in
CacheClientTestCase class
- add test cases for get_client function in
GetClientTestCase class

Change-Id: Idff48cbc1cf8c1f33125c258e97a4587bb1123bd
Log unhandled exceptions

Enable logging of unhandled exceptions within the WSGI server.  In the
case of an internal server error a stacktrace will be logged if glance
API or registry has the verbose option set to True.

Partial-Bug: #1246968
Change-Id: I68390495331ba30dab1cd60584d0ed01357514ae
Fixes image delete and upload contention

If an image upload completes during a delete on the same
image, the image data may not be deleted. This patch
resolves this issue and provides a unit test to test it.

Co-authored-by: Hirofumi Ichihara <ichihara.hirofumi@lab.ntt.co.jp>
Change-Id: I913cd3e4963b7b60da6a856eb820c1afcc9017d7
Fixes: bug 1245099
Merge "Fixes image delete and upload contention"
Clean up numeric expressions with oslo constants

Replace numeric expressions with olso constants to make code
more readable. This patch won't replace single 1024 if 1024 not
in an expression like number * 1024.

Change-Id: Ic1137774f0f9a2be89a7c2706d6eb52eb906ff1f
Merge "Clean up numeric expressions with oslo constants"
Sync openstack.common.local from oslo

`local` has a broken TLS symbol - strong_store, fixed in oslo some time ago in
Ib544be1485823f6c619312fdee5a04031f48bbb4. All direct and indirect
(lockutils and rpc) usages of strong_store might be potentially affected.
Original change to Nova: If4dd973acc23921dbc2bc69bb76225deb2802dad

Closes-Bug: #1254046
Change-Id: I934149092cacaaa78009565b6d8a6ba348c2dbe4
Merge "Add tests for glance/image_cache/client.py"
Imported Translations from Transifex

Change-Id: I5f66ae08d76954b18441484db4fbdc303da942da
Merge "Fixes content-type checking for image uploading in API v1 and v2"
Merge "Sync openstack.common.local from oslo"
Explicit listing of Glance policies in json file

Most OpenStack components do list their policies in their policy.json but not
Glance. It will let user directly know what options is available to them.
Previously non-listed policy do follow the default rule now.
List of available policies have been taken from Developer Guide page :
http://docs.openstack.org/developer/glance/policies.html#constructing-a-policy-configuration-file

Closes-Bug: #1254461
Change-Id: I833db8385c2d3e8962a9c19b77c94d962eac475e
Merge "Log unhandled exceptions"
Add config option to limit image properties

This patch adds the image_property_quota config option. This allows a deployer
to limit the number of image properties allowed on an image. The default value
is 128, as is currently the limit enforced by nova. Users will only be able to
update an image if the result of the transaction would be under this limit.
This behavior is intended to be similar to 'quota_metadata_items' in nova.

This is for both Glance v1 and v2.

Fixes bug 1251518
docImpact

Change-Id: I4aa9504deae836404f11c9ada71a91f85caeba4c
Merge "Explicit listing of Glance policies in json file"
Merge "Add config option to limit image properties"