Add unit tests for glance.api.cached_images module

Add positive unit tests for methods:
* get_chached_images
* delete_cached_images
* get_queued_images
* queue_image
* delete_queued_image

Fixes: bug #1155188
Change-Id: I3fa6dc28a72e8c6e8402911931fb37e18cba7ea0
Remove internal store references from migration 015

Migration 015 was accessing a object internal to the swift store driver
and changing its behavior in order to do the migration.  This worked but
it made the assumption that the driver logic would not change without
also changing the migration code.  These two should not be dependent
upon each other.  This patch removes all dependencies on swift from the
migration code.

Fixes bug: 1025746
Change-Id: Ic9559ae809b8784d0992cb5275d3911a725110c8
Add a policy handler to control copy-from functionality

This patch adds the ability to set a policy handler to control what
users can use the 'copy_from' feature in the v1 API.

Fixes bug: 1153614

Change-Id: Ie194979a2aa66c9327bf14d7a85ead6f773a6079
Verify SSL certificates at boot time

When Glance is configured to run with SSL this patch will check
that the certificate and key exist, are readable, and match each
other at boot time.  If any of the above conditions fail an friendly
error message is logged directing the operator at a solution.
Previously the keys were not checked until a client connected.

fixes bug: 1160529

Change-Id: I16975608f9ae40ac5b84b3caa52ed5f8e22f296e
Add GridFS store

This patch adds support for GridFS to glance. GridFS is 10gen's, mongodb
based, distributed filesystem.

The store requires 2 options in order to work correctly:
    * mongodb_store_uri
    * mongodb_store_db

Note: mongodb was used in the parameters name's even though this store
supports `gridfs://` schemas (not official) in order to keep consistency
with mongodb's documentation and connection parameters.

GridFS StoreLocations:

This store implements gridfs locations with the form `gridfs://<IMAGE>`.
Note that there's no connection information in those uris, which was
consciously omitted for security reasons. Perhaps, it could be possible
to make that information available by setting a configuration parameter
that specifies so.

Implements blueprint gridfs-store

Change-Id: I38f361ac8421f0445dd37800c840441a46cf9fdf
Improve unit tests for glance.api.middleware.cache module

Add tests for glance.api.middleware.cache module

Fixes: bug #1152053
Change-Id: I6e99c70b0d8ae20011b4ad9bea76d5e4e1dff921
Call monkey_patch before other modules are loaded

This patch moves the monkey_patch call into the glance scripts that
needs libs to be monkey_patched. This seems to be a good practice and
has given good results for other projects as well.

This change is needed  to avoid loading / initializing modules
before other libs are patched. For example: logging module.

Fixes bug 1163722

Change-Id: Idee486851606d765fb11598967a4f7d56cf46c97
Fix functional test 'test_scrubber_with_metadata_enc'

This test fails if a real swift system is specified in a config file
and passed to the tests via the GLANCE_TEST_SWIFT_CONF environment
variable. The fix is to allow location schemes of the form
'swift+http' as well as 'swift+https'.

Fixes bug 1158805

Change-Id: I9fd3a9c02b31acc2a8313acd3b88124a17d0adfb
Fix the deletion of a pending_delete image.

Return '403 - Forbidden' when trying to delete
a 'pending_delete' image, and does not change
its status.

Change-Id: Id5b8b31c19d0f9da8aba66b06d1b966e9c33a363
Fixes: bug #1163020
Fix Qpid test cases

The Qpid notification test cases do not currently pass.
By default they are skipped because qpid is not part of
test-requires, so it isn't automatically installed.  This fix
updates the test cases to work correctly, but does not add
qpid to test-requires because I'm unsure what impacts that
might have on other platforms.

This is part of the fix for bug 1164681

Change-Id: I40757b5de99559b4ff090e0d249f8624c2e2be10
Gracefully handle qpid errors

If a qpid error occurs when Glance is sending notifications, the
qpid connection may not be cleaned up properly.  This change catches
qpid exceptions to allow proper error handling.

Fixes bug 1164681

Change-Id: Ica3ef54b958e4efe3932b90d721324e7860b1ea4
Sync with oslo-incubator copy of setup.py and version.py

Keep up with the changes to the master copy

Change-Id: I1cc2ca0e627f25a86b0adc6df9bb9d4a12a3cdcf
Fix test redifinitions

A few testcases had duplicate names, which caused
the original test to be redefined and not executed
anymore. Also one case was apparently entirely duplicate.
Raises unit test coverage by two tests.

Change-Id: Ibf3db93b7fee875877c1bac8797eb88fc9a99874
Merge "Fix test redifinitions"
Merge "Add GridFS store"
Merge "Improve unit tests for glance.api.middleware.cache module"
Merge "Fix the deletion of a pending_delete image."
Merge "Fix Qpid test cases"
Merge "Add unit tests for glance.api.cached_images module"
Merge "Verify SSL certificates at boot time"