Adds sample config file generation script

Having this script placed in oslo will let projects avoid implementing
their own sample generation script.

Change-Id: Ifed266ef65aee72da2e16ff30b7bde1e834650da
Add exceptions for OpenStack clients

These exceptions can be used in novaclient, keystoneclient,
glanceclient, and other client projects.

Concept of this file comes from cloudservers/exceptions.py
and novaclient/exceptions.py. HTTP exceptions were rewritten.

Partially implements: blueprint common-client-library

Change-Id: I9e17d855f7c26284ce66b13515aa4a0b8855347a
Allow launchers to be stopped multiple times

Makes launchers play nicely with unit test fixtures in nova.

bug 1199315

Change-Id: I00306821d1437324262ba8a3154b8a837bfb6434
Avoid shadowing Exception 'message' attribute

The Exception class has a 'message' attribute:

  >>> Exception('foo').message
  'foo'

however, we follow a pattern that results in the attribute being
shadowed by a class attribute:

  >>> class MyException(Exception):
  ...     message = 'Foo %s'
  ...     def __init__(self, bar):
  ...         message = self.message % bar
  ...         super(MyException, self).__init__(message)
  ...
  >>> MyException('bar').message
  'Foo %s'

whereas, we obviously want behaviour like this:

  >>> class MyException(Exception):
  ...     msg_fmt = 'Foo %s'
  ...     def __init__(self, bar):
  ...         message = self.msg_fmt % bar
  ...         super(MyException, self).__init__(message)
  ...
  >>> MyException('bar').message
  'Foo bar'

Avoid this shadowing by using 'msg_fmt' as the name of the class
attribute. Add a test which fails without this fix.

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

Some checks in policy module missing a argument, this
patch fixed it by adding the necessary argument.

Fixed bug #1194354

Change-Id: I41338675842be517146062d11012462c5c90d6e5
Migrate sqlalchemy utils from Nova

These utils are useful for database schema migrations
and can be reused in other projects.

Blueprint: oslo-sqlalchemy-utils

Change-Id: Ie54fcd5d75de05b48cca8b86c19325d7327f39cd
Move `test_migrations` from Nova.

Added class WalkVersionsMixin with common methods for migration tests
(`_migrate_up()`, `_migrate_down()` and `_walk_versions()`).
Tests added.

blueprint test-migrations

Change-Id: I6689c7a01bba7a146ac402a1fe72768a29c72161
python3: Add basic python3 compatibility.

Use six.text_type to replace unicode() in python2
and str in python3.

Change-Id: I61e961248241014380ec464429f2585a9497333b
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Add .testrepository to .gitignore

Add .testrepository to .gitignore

Change-Id: I9c9eaace4fd5d42786cf73d93bfdf525a24af8ff
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Make lock_file_prefix optional

Currently, the lock_file_prefix says it should end with an hypen if
specified. It seems that it was intended to be optional. Since that
behavior makes sense, this patch changes the synchronized's signature
and makes lock_file_prefix optional.

With this patch, the prefix will not be required to end with an hypen
anymore, such sign will be added to the prefix if specified and if not
already present.

This patch doesn't change synchronized's behavior at all, which means it
doesn't break backward compatibility.

Change-Id: I8841da1e8d105aac4a86b247228a9c935e00afc5
Move synchronized body to a first-class function

synchronized is being widely used throughout OpenStack for managing
locks by decorating methods / functions. However, it's functionality is
trapped within that decorator definition and makes it difficult to
manage locks by using it in other cases (like w/o decorating).

This patch moves decorator's body into a first-class function called
lock which is intended to be used as a context manager type (with
statement).

Some examples:

    with lockutils.lock("test") as sem:
        print('Inside the lock')

Things I'm not 100% convinced:

    * The `lock` function yields a Semaphore when external is False and
    an InterProcessLock instance otherwise. Although it is not 'good' to
    yield different values depending on the input parameters, it's
    pretty explicit (by reading the documentation) that external locks
    are handled differently. Other options for this case are:

        1. Always yield a Semaphore instance
        2. Don't yield anything

The patch doesn't break backward compatibility so no change is needed to
existing projects.

Implements blueprint cache-backend-abstraction

Change-Id: I96b2ee84da5a2dcd7f0bd469f8a1e52b74e50c75
python3: Add python3 compatibility support

Add python2/python3 compatibility support:

- Use six.iteritems() to replace dictionary.iteritems()
  on python2 or dictionary.items() on python3.

- Use six.advanced_iterator as a replacement to call
  it.next() on python2 and next(it) on python3.

Change-Id: I48442696b66392de33520714b9beb2c645ec1b58
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Merge "Adds sample config file generation script"
Merge "Avoid shadowing Exception 'message' attribute"
Merge "Add exceptions for OpenStack clients"
Fix stylistic problems with help text

The help text for the backdoor_port configuration option was a little
groddy.  This reformats it to clean it up a little.  Some punctuation
is also added to clarify the meaning of the text.

Change-Id: Ie61be9f0d08cd9c2485177b207216b3b775acd04
Merge "Add .testrepository to .gitignore"
Add more robust gettext interpolation handling

While integrating the new delayed messaging gettextutils
functionality into Nova, there were issues with handling
the string interpolation operations. This change adds some
paths for dealing with these cases, such as non-deep-copyable
parameters, and python code-like objects. Also, adds some
much needed test coverage.

Change-Id: I65879875adf7a12fa0d1873167c2efadfc23a54b
Fixes path to add on PYTHONPATH in generate_sample.sh

Fixes bug #1201699

Change-Id: I51aca3b05866e513cbbb3163df7e5514d99af192
Add maintainer for apiclient

Change-Id: Iabdb302eb530f74c6965077dfe1abb8b24cf73fe