Catch exception when image cache pruning

If a cached image file does not exist, os.stat will throw an exception
and the glance-cache-pruner can fail to run when it encounters
the non-existent file.

Adds a catch for the possible exception and sets file size to 0 so
the glance-cache-pruner can successfully run and prune the cache.

Change-Id: I55bee82c4a7aa0393d36c603c91adb8b44a7c7a3
Fixes: bug #1286240
Include Location header in POST /tasks response

In addition to returning a 201, a successful POST to /tasks
should include a Location header with the direct path to the
newly created resource.

Closes-bug: #1287760

Change-Id: I11001e1d6bb5168f0ee80c3d81574e59ddd47147
Fix glance db migration failed on 031

In fact, the first where expression has filtered the duplicated locations,
and the second filters the locations which have more than 1 rows, so the
second result set is included in the first.
In DB2, if the boolean of where expression is true, it will throw error.
So remove the second where expression to fix glance db migration failed on 031.

Fixes bug #1287087

Change-Id: Id485b6d20696e989d10f3759011387137543918a
Add copyright text to glance/openstack/common/__init__.py

Synchronize the content of glance/openstack/common/__init__.py to the
one in oslo-incubator.

Change-Id: Idd059e3f4d00d91c9a14cf302fd780044929e3e5
Closes-bug: #1288877
API v2: Allow GET on unowned images with show_image_direct_url

This fixes an issue where copy.deepcopy was being a called
on an ImmutableLocations object, causing a Forbidden to be
raised.

Change-Id: Ia7ac121478cf63d68bd5a3d91faa51a42afeb2fe
Closes-Bug: 1287888
Merge "API v2: Allow GET on unowned images with show_image_direct_url"
Merge "Include Location header in POST /tasks response"
Merge "Catch exception when image cache pruning"
Merge "Fix glance db migration failed on 031"
Makes possible to enable Registry API v1 and v2

This change will make possible to enable/disable both v1 and v2 Registry APIs
either individually or together from glance-registry.conf.

DocImpact
Closes bug: #1290432
Change-Id: Ib2458b3312bdb552975b1e42485086a1c3aa6d3f
Make the VMware datastore backend more robust

This patch contains several fixes related to invalid configurations
and corner cases:
- better error handling for the store operations
- better logging when response is not successful
- better support for various store_image_dir formats

Change-Id: I6c0003e29d621c1f71490cb9fce163dc840a113f
Closes-Bug: #1291646
Merge "Add copyright text to glance/openstack/common/__init__.py"