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
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
Provide an upgrade period for enabling stores

1f6381a73f5c99f1f731d6c4f9defb91bd2d042d disabled all stores by default,
this casues upgrade issues for CD environments and folks that are not
aware of the change. This patch adds a way to attempt enabling the store
if its configuration parameters were set. If the store fails to load and
it's not in `known_stores` then no error will be reported.

The patch also warns the user when a store succeeds to load but it was
not explicitly enabled in `known_stores`. Note that there may be false
positives since some stores may not require any configuration parameter.

Change-Id: Ie784fe90003a5064aaf16fadb7266bf7a46e2cf5
Closes-Bug: #1290969
Updated from global requirements

Change-Id: Ic042a64906cf69214261d6651787c08c6f025ea5
Merge "Provide an upgrade period for enabling stores"
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"