Apply image location selection strategy

Apply image location selection strategy into Glance server side. Image
download handling and "direct URL" exporting will be effected by this
mechanism.

Implements bp: image-location-selection-strategy

Related-Id: I86f192aeae8e5f21a72f946552f6507654c25a6c
Change-Id: I7bd093a16db3af2b604cad22a6b6971345af82a2
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Merge db.sqlalchemy from oslo-incubator 6d0a6c3

The db.sqlalchemy module was not recent with oslo-incubator.
The latest oslo-incubator db.sqlalchemy contains a fix(fa0f36f)
for the following problem, which caused a regression in Glance:

The database connection string was not marked as secret, so it
would be printed out in cleartext in the logs when config settings
were logged.

The database connection string typically contains the password
that's used to connect to the database, so it should be marked as
secret so that it doesn't get logged.

b4f72b2 Don't raise MySQL 2013 'Lost connection' errors
271adfb Format sql in db.sqlalchemy.session docstring
eff69ce Drop dependency on log from oslo db code
11f2add Clean up docstring in db.sqlalchemy.session
1b5147f Only enable MySQL TRADITIONAL mode if we're running against MySQL
39e1c5c Move db tests base.py to common code
986dafd Fix parsing of UC errors in sqlite 3.7.16+/3.8.2+
9a203e6 Use dialect rather than a particular DB API driver
1779029 Move helper DB functions to db.sqlalchemy.utils
bcf6d5e Small edits on help strings
ae01e9a Transition from migrate to alembic
70ebb19 Fix mocking of utcnow() for model datetime cols
7aa94df Add a db check for CHARSET=utf8
aff0171 Remove "vim: tabstop=4 shiftwidth=4 softtabstop=4" from headers
fa0f36f Fix database connection string is secret
517c4cc Merge "SQLAlchemy error patterns improved"
8b2b0b7 Use hacking import_exceptions for gettextutils._
3017e1d Merge "Add docstring for exception handlers of session"
9bc593e Add docstring for exception handlers of session
e40903b Database hook enabling traditional mode at MySQL
40aea8b Merge "Remove unused import"
c802fa6 SQLAlchemy error patterns improved
1c1f199 Remove unused import
6d0a6c3 Correct invalid docstrings

Closes-Bug: #1266950

Change-Id: Ib6025218846f01372d6da61e30f17374cad56f7d
Add unit tests around glance-manage

Adds unit tests around glance-manage

Implements bp adds-tests-around-glance-manage
Change-Id: Ia40030ee00b2555e1ee6f57760d2794a45f25325
Merge "Apply image location selection strategy"
Merge "Merge db.sqlalchemy from oslo-incubator 6d0a6c3"