Move sqlalchemy migration from Nova

Added functions for work with migration scripts to
openstack/common/db/sqlalchemy/migration.py file. This code can be used
in Nova, Cinder, Glance, etc. Added new DbMigrationError exception to
openstack/common/db/exception.py file.
Tests added.

blueprint test-migrations

Change-Id: Ia63f7fb89b0a6baacf3fd424c0db09c74680af4a
Fix missing argument bug in oslo common policy

AndCheck() and OrCheck() classes in common policy module missing a argument
when calls rules in __call__() method.
Current patch fixed it by adding the necessary argument. Tests added.

Fixed bug 1194354

Change-Id: I9a6e7d04b06ef61216cb7dbfd291c855b799b621
Helper function to sanitize db url credentials

The database url is sanitized in logfiles because of security issues.
However the connected url itself is useful information to devs and admins.
This patch provides a helper function to sanitize only the credentials
in a database url. All projects must process the CONF.database.connection
value using "sanitize_db_url" when updating the db package

Fixes bug #1076833

Change-Id: Id6cf7b120ef6c3fcda7f33fd26676b62a4475bb2
RPC: Add MessageSecurity implementation

Add Message Security[1] class and exceptions
Also add process-local Key Storage and Caching facility.

[1] https://wiki.openstack.org/wiki/MessageSecurity

Change-Id: Ieced7ab6a9209c3e0291d26376a8d35c25175002
Add common part of test-related tools to oslo

Add BaseTestCase class - testtools wrapper;

Blueprint: common-unit-tests
Change-Id: I5bce04f2ee55f678ea5a2a2c76f5837454ed7bb7
Merge "RPC: Add MessageSecurity implementation"
Some nitpicky securemessage cleanups

Remove redundant parenthesis and use a consistent commenting style.

Some redundant parenthesis are retained to avoid this pep8 silliness:

  https://github.com/jcrocholl/pep8/issues/126

i.e. to avoid E125 we have the choice of:

        if (md['source'] != source or
                md['destination'] != target or
                md['expiration'] < time.time()):
            raise InvalidEncryptedTicket(md['source'], md['destination'])

or:

        if ((md['source'] != source or
             md['destination'] != target or
             md['expiration'] < time.time())):
            raise InvalidEncryptedTicket(md['source'], md['destination'])

the latter is my preference.

Change-Id: Ic890bfc787a17fc77821e01e586806d1b558d530
Remove redundant global keyword in securemessage

The global keyword is only needed where we are assigning to the variable
in the method.

Change-Id: If9f3fcc5323e2a154db1f5b457ce3d5079f83253
Don't shadow cfg import in securemessage

Change-Id: I03ed9f1cbbc08dea43a5c93d6997eb4e633dfed4
Clarify precedence of secret_key_file

If secret_key_file is set, then secret_key is ignored. Clarify this in
the help strings.

Change-Id: Ie10ebb7c76e274b31ab9826a81373518c9b09e0a
Merge "Don't shadow cfg import in securemessage"
Merge "Remove redundant global keyword in securemessage"
Merge "Some nitpicky securemessage cleanups"
Add a fixture for dealing with config

Many tests change config's variables directly in CONF object. This
fixture allows to override the values in more convenient way and
restores config after test completion.

Blueprint: common-unit-tests
Change-Id: I5535c534425278d8804ca9fe84846e15ac898db0
Merge "Add common part of test-related tools to oslo"
Merge "Move sqlalchemy migration from Nova"
Merge "Helper function to sanitize db url credentials"
Merge "Fix missing argument bug in oslo common policy"
Merge "Add a fixture for dealing with config"