Honor metadata_encryption_key in glance domain

Since v2 is not using the registry client, it was not properly
encrypting image locations before storing them in the database. With
this change, the db layer in the glance domain now uses the metadata
encryption key as well.

To make this work, the declaration of the metadata_encryption_key option
had to move to glance.common.config to avoid circular module
dependencies.

Fixes bug 1128650

Change-Id: I3bb5da92ffda7bfe1bc064d11da8ecd4e6d9ab1d
Fix check_003 method.

This commit fixes the check on migration 003 in test_migrations.
Previously, when this method was added it didn't check that the
data in the type column previously in the images table was moved
correctly into the image_properties table. This commit adds these
data checks.

Change-Id: Ia3906c8497218c8a3d2a13b0c99a6aa566977ed4
Insure that migration 6 retains deleted image property index.

Migration 6 for sqlite deletes the entire table and then recreates it,
however it fails to create the image_properties deleted index.

Fixes bug: 1051123

Change-Id: I4740ff1d5b9ec44067e6af7dd822329105222690
Retain migration 12 indexes for table image_properties with sqlite.

The upgrade from migration 11 to 12 for sqlite fails to create the
existing indexes when it recreates the image_properties table.

Fixes bug: 1152386

Change-Id: I2ceba3d9c5c45f40564af12fa48c4efba1467021
Characterize image_member_find

Add tests to characterize the current (incorrect) behavior of
image_member_find in the database drivers.

Change-Id: I0fc3bb05dbc1376d3bd8e002306b402e960780cf
Fix calls to image_member_find in tests

A few tests of image members in v2 were passing invalid arguments to
image_member_find. This problem showed up in a later patch where
image_member_find actually tries to make use of the context it was
passed.

Change-Id: I0611db9bf83ebf262e9d2a0ef33c805d23658f2a
Fix visibility on db image_member_find

Before this change, image_member_find was not paying any attention to
whether or not the requesting context was authorized to view the image
memberships. With this change, image membership results are always
limited to either images owned by the context tenant, or images shared
with the context tenant.

Fixes bug 1114821

Change-Id: I9cabe218429e32c7e2db932ced141e056e10d1c5
Fix up publicize_image unit test

The 'test_add_public_image_unauthorized' unit test wasn't checking
the 'publicize_image' policy as expected.

Replace it with new tests 'test_add_publicize_image_authorized' and
'test_add_publicize_image_unauthorized' which perform the check as
expected and verify both authorized and unauthorized code paths.

Fixes bug 1153670.

Change-Id: Ib095763a246df6aa16e1310f25b7a0d442229f1a
Fix circular import in glance/db/sqlalchemy

Fix running test_migration solely.

api.py depends on models.py that depends on api.py.
Import statements in these files are such that api.py
must be imported before models.py. That's why usually
test_migrations doesn't fail when all tests are launched.
However, thus test_migration depends on test running order
making testing procedure unreliable, including parallel testing.

Move glance.db.sqlalchemy.api import to the only place
where it's required in models.py

Change-Id: Ib20dde8edd3473595aac1ca8bbaa5a0d3116a697
Fixes: bug #1154058
Mark password options secret

Mark password options secret in kombu and qpid notifiers.

Fixes bug 1154096

Change-Id: Ifa25ac791e2accce50eafb242f2466681f7ca457
Switch to final 1.1.0 oslo.config release

Fixes bug #1128256

oslo.config has now been released to PyPI in time for Grizzly RC1 so
we can switch to using it directly.

Change-Id: I655f831718ae5f4e25e941ee206fe195214a9a91
Publish API version 2.1

Fixes bug 1154317.

Change-Id: I1e044539952f649974c757183e9bb2551264850e
Merge "Retain migration 12 indexes for table image_properties with sqlite."
Merge "Fix up publicize_image unit test"
Merge "Mark password options secret"
Merge "Fix visibility on db image_member_find"
Merge "Switch to final 1.1.0 oslo.config release"
Log when image_size_cap has been exceeded

Add a log entry when an attempt to upload an image whose size is greater
than image_size_cap has been made.

Addresses bug 1154606.

Change-Id: I836cb2dad1c130c0df15d26a87229b60a6cc3033
Merge "Honor metadata_encryption_key in glance domain"
Merge "Publish API version 2.1"