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
Rename duplicate test_add_copy_from_upload_image_unauthorized

Rename 2nd implementation of
test_add_copy_from_upload_image_unauthorized to
test_add_copy_from_upload_image_unauthorized_with_body, as it
also passes a body as part of the test.

Change-Id: If080f51bfbc3f51257977bcffa01b07d7f06e45b
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
Make Glance code base H102 compliant

Add the Apache headers where it was missing so the Glance
code base can be H102 compliant

Change-Id: If19841d1752f7ec364098333429ce090374e79cd
Closes-bug: #1263537
Merge "Rename duplicate test_add_copy_from_upload_image_unauthorized"
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"