Use openstack-common's policy module

Reworks glance to use the new policy module in openstack-common.

Change-Id: I6012c71a16d83762535e7490d8f5bc5102160fc0
Made changes to adhere to HACKING.rst specifications

Change-Id: I6a6fe0c2db55f57a74b5968224571c2c1440696c
Port remaining code to global conf object

Implements blueprint cfg-global-object

This iteration fixes up the remaining places where we're passing a
conf object around.

Change-Id: I3b627d093a6b7afeee129ab66b377a3b0af5439b
Remove the conf passing PasteDeploy factories

Implements blueprint cfg-global-object

In glance.common.wsgi we have a paste_deploy_app() API which allows
a ConfigOpts instance to be passed the the applications and filters
constructed by PasteDeploy.

Now that we're using a global object, we don't need this anymore

Change-Id: I222d3c58308bc2f504cd802c0c8405d3baa2e49a
Update default values for known_stores config.

Updates the default value for the 'known_stores' config
variable to include the full list of storage classes
supported in Glance.

Also, removes the known_stores config section from the
example config file since it is arguably an advanced config
that won't get used by most users. Removing this config avoids
the overhead of maintaining internal class names in config files.

Fixes LP Bug #1008698.

Change-Id: I0117376aa4de3103410ecb1a36df6998fcd0d5b5
Merge "Port remaining code to global conf object"
Merge "Update default values for known_stores config."
Merge "Use openstack-common's policy module"
Add tests and simplify GlanceExceptions.

This also fixes some incorrect use of GlanceException parameters.

Fixes bug: 1009122
Fixes bug: 1010140

Change-Id: Ic77856686a0259da2318e05b15f3d382508c00b9
webob exception incorrectly used in v1 images.py

Fixes bug 1010681

Change-Id: I42cf5a8e87e07b94fbba4af7ad3b16a62817007e
Begin replacement of sqlalchemy driver imports

Create glance.db:get_api to handle importing the configured data
api module. Currently it's hard-coded to glance.db.sqlalchemy.api.

Related to bp refactor-db-layer

Change-Id: Ie9b078bddf6324bf0e76d562489a6695ed8b88df
Move RequestContext.is_image_* methods to db layer

These methods need direct access to the db and therefore require
the request context module to maintain a connection to the database.
Moving them to the db layer allows us to further refactor the
db layer.

This does duplicate the methods in each of the db drivers, so a
future patch is needed to simplify that.

Related to bp refactor-db-layer

Change-Id: Ia7e0dbb9f2162fb69837699b970f8cab3efcd545
Import db driver through configuration

Using the 'data_api' config option, a deployer can now define
which module to be used as the db driver.

Related to bp refactor-db-layer

Change-Id: Ie93b7331e5f8f3456b682d974ac6fd2cdb1e53b7
Fix to not use deprecated response.environ any more.

WebOb 1.2 doesn't auto-set the response environment. There was only one place
in Glance that was using this, so it was changed in favor of the stable API
that has always been there: response.request.environ.

This change fixes bug #1010560.

Change-Id: I2e58bf32970c95d25cad0a35ee38b9540483eef0
Merge "Remove the conf passing PasteDeploy factories"
Use python-swiftclient for swift store.

- Use python-swiftclient instead of swift.common.client (pinned to
  github hash).
- Fixes bug 1002791.

Change-Id: Ibdc00b75c62445a7f0930ee1806ad469e3d3ffe2
Merge "webob exception incorrectly used in v1 images.py"
Fix help messages for --debug.

Fixes LP Bug #1012746.

Change-Id: I54af0d20b3f5b56a1b350de3ac1324f1bbcd57ed
Add metadata_encryption_key to glance-cache.conf.

Fixes LP Bug #1012752.

Change-Id: I802583e2766cd1533223638259e57e44b39448eb
Use zipballs instead of git urls.

Additionally, update openstack.common.setup

Change-Id: I6e72ac890ed93ab5201fe99f63fd579a9d9db89b