Adding missing copy_from policy from policy.json

The current policy.json file is missing the copy_from policy in order
to be exhaustive.

DocImpact
Change-Id: Ibc0d1fa7626629c28c514514a985a6b89db2ac69
Closes-bug: #1258999
Adds guard against upload contention

Protect against concurrent image uploads by allowing the
initial request to proceed and succeed and subsequent
concurrent requests to fail.

We now allow the upload activation to specify what state
it expects to transition to 'active' from. If by the time
the db is updated the transition has already occured i.e.
another upload has succeeded, the upload will fail and data
will be cleaned up.

Fixes: bug 1241025
Change-Id: Ie532b61484bec660910fb9a37429397bde8ef11f
Add db2 communication error code when check the db connection

Closes-Bug: #1244092

The oslo patch set is 3acd57c2825a8bf6660c3124f12794414622eb26

Change-Id: Ic5244cab4e517f740b398138d4da877affe46ab3
Cleanup: remove unused code from store_utils

store_utils.py contains several methods not used anywhere in the
codebase.
This patch removes the unused code.

Change-Id: I8faa87e1dcce053b19a37c19856eb53529e0ec78
Closes-Bug: #1262051
Remove duplicate method implementations in ImageLocationsProxy

Change-Id: I85f55fbaa290956ad03edbc8d019f73daa02d0a9
Enable H233/H301/H302 tests that are ignored at the moment

  * H233 use of print operator
  * H301 one import per line
  * H302 import only modules

Change-Id: I752c3c117e2575b30cc96d68c18df365d595588e
Closes-bug: #1263535
Merge "Adding missing copy_from policy from policy.json"
Use uuid instead of uuidutils

Each project should directly use the standard uuid module.
uuidutils will be deprecated/removed in this cycle.

This patch replaces every uuidutils.generate_uuid() with
str(uuid.uuid4()) and uuidutils.is_uuid_like()
with utils.is_uuid_like().

Change-Id: I43642d4f1e137c14134b3d544e367b504b9851ac
Closes-Bug: #1253497
Empty files shouldn't contain copyright nor license

http://docs.openstack.org/developer/hacking/#openstack-licensing

Change-Id: I29a1a4bdd023adc219a1927180a4c37a735ec6dc
Fixed wrong string format in glance.api.v2.image_data

Closes bug 1264089

Change-Id: If6d72406b0e717f0f944a0b9d1ab4a0fc9301e6a
Merge "Adds guard against upload contention"
Refactor tests.unit.utils:FakeDB.reset

glance.tests.unit.utils:FakeDB uses glance.db.simple.api which has
already implemented reset() functionality, the redundant code in
FakeDB should be removed.

Change-Id: I140e932e9cc531900cee503e20d3549549b13d27
Closes-Bug: #1264204
Merge "Fixed wrong string format in glance.api.v2.image_data"
Merge "Cleanup: remove unused code from store_utils"
Correct URL in v1 test_get_images_unauthorized

The test code in
unit/v1/test_api.py:TestGlanceAPI.test_get_images_unauthorized
requests for the wrong URL - instead of requesting for "/images" it
requests for "/images/detail" (making it identical to the
test_get_images_unauthorized test).

Change-Id: I308e73966bcbb27287012d7b5dcdcc9d2a9f2e18
Closes-Bug: #1264428
Merge "Remove duplicate method implementations in ImageLocationsProxy"
Merge "Add db2 communication error code when check the db connection"
Merge "Correct URL in v1 test_get_images_unauthorized"
Merge "Use uuid instead of uuidutils"
Remove the redundant code

In methods 'version_control' and 'db_sync' in glance/db/sqlalchemy/migration.py,
there are redundant code 'sql_connection = CONF.sql_connection'.
The 'sql_connection's are local variable and not used.

Change-Id: Ie8a12e6f385f7103463172ed9acde1de0336a6d4
Closes-Bug:#1264056