Raise 400 error on POST/PUTs missing request bodies.

Fixes bug 1034972

Change-Id: I1847972c83353452381c0ee5eee2eb75f51d1dbc
Add policy enforcment for v2 api.

This patch adds policy checks in the images controller for all actions that need
to be enforced. It also fixed an issue with unit tests where the v1 unitests
were testing less than they should be. This was due to the default policy being
overridden in the test and causing a forbidden to be raised whenever policys
were changed, regardless of the policy rule added.

Fixes bug 1036846

Change-Id: Ib351d8c1e13164d02b02685c808b30045f7850ea
Updates Image attribute updated_at

When the image properties are updated, the image attribute updated_at
should be updated as well.

Fixes bug 1036507

Change-Id: I889eab92e8f182633ab6e462cac1ff7ab0cb1223
Fix build_sphinx setup.py command.

The DB migrate manage script needed to be wrapped in an if statement
so that the autodocumentation did not barf on it. Additionally add a
copyright header while we were editing the file.

Change-Id: I0a37036d304790b52dde7fb68d37a6c99204b596
Merge "Updates Image attribute updated_at"
Merge "Raise 400 error on POST/PUTs missing request bodies."
Fixes issue with non string header values in glance client

Fixes bug 1032798

By using Glance client on Windows the following exception is raised:

TypeError: sequence item 0: expected string, long found

Details on how to reproduce the error are available in the bug description

Change-Id: Ib4528702b11aabdf939c6358f92ad7ff9c3ff20d
v2 Images API returns 201 on image data upload

Fixes bug 1037391

Change-Id: I93607874b932de658cc301a6f9bc53c83af66383
Merge "Fix build_sphinx setup.py command."
Validate uuid-ness in v2 image entity

The image entity was allowing any string value to pass through in
an image create operation. We should limit it strictly to UUID-like
values.

Fixes bug 1037725

Change-Id: I3f28d3f2dc5c0f63322efe250051874d7975ec1f
multi_tenant: Fix 'context' is not defined error

Corrects the variable name 'context' to be 'self.context' in the
configure_add method of the swift store. We changed/moved this code
late during the review process of the multi_tenant swift feature
and obviously didn't add a functional/unit test on the new location
which now causes this exception to get thrown:

    NameError: global name 'context' is not defined

This patch also includes a new glance function test to startup
the Glance API in multi-tenant mode. The test_multi_tenant_mode
test will fail with the previous swift store implementation.

Fixes LP Bug #1037745

Change-Id: I7681ad704b169c5fe815adf2fe704e5d18ea8e83
Set proper auth middleware option for anon. access

Fixes bug 1037793

Change-Id: I89c05b5004f6a93608c0e23302f04b95b9018c29
Remove unused imports

Fixes bug #1037592

Change-Id: I3365d028ab67931517d2f94cc4b7e3752fbdb869
Merge "Validate uuid-ness in v2 image entity"
Fix auth cred opts for glance-cache-manage

The glance-cache-manage binary now supports the same auth env
variables and flags as python-glanceclient. The old flag formats
are still supported (but not documented) to support backwards-
compatibility.

Fixes bug 1038112

Change-Id: If9f15d030e3167f5c81ea275c0005c854cd94a40
Add DB Management docs

Fixes bug 909064

Change-Id: Ifd477b345dfb03efe8e8e5befa03a0cb2a3c3ce8
Merge "multi_tenant: Fix 'context' is not defined error"
Return httplib.HTTPResponse from fake reg conn

Fixes bug 1038219

Change-Id: Ib7e205398c532007d189cdde3ab850b721f06a2a
Correctly re-raise exception on bad v1 checksum

The exception re-raise during v1 image upload operation was
failing due to some weirdness in _safe_kill. This patches over
the problem by explicitly re-raising the caught exception object
after doing the necessary teardown.

Fixes bug 1036470

Change-Id: I0929bb3b2ac88f0b80f47eb61e642fe1fee35218
Make max image size upload configurable

Add conf option image_size_cap to represent what the internal
IMAGE_SIZE_CAP constant used to cover in the v1 API. The default
is reduced to 1 TB from 50 PB.

Thoroughly test this on image create and update through the v1 API.

Fixes bug 1038994

Change-Id: Ie0985b62228f8b28c005a8847049d7b68d9b959a