Don't eat callback exceptions

In order to properly ack(), reject() or requeue() messages
we need to preserve any exceptions thrown by the callbacks.

Change-Id: Icc7a38b69dc0812f94475530f5573342d92a6590
parameterize fileutils removal functions

Currently delete_if_exists() and consequently
remove_path_on_error() only support single files.
So to handle dirs, or trees or higher level operations
it's useful to be able to specify how to remove.

* openstack/common/fileutils.py (delete_if_exists):
Allow passing a removal function.
(remove_path_on_error): Likewise.
* tests/unit/test_fileutils.py (test_dir_present):
Demonstrate/test removal of empty dirs.
(test_remove_dir): Likewise.
(test_remove): Ensure the remove param is honored.

Related:   Idce8d21ae37bfdbb28a2567120a83d1061061904
Change-Id: I0ea2498048f09af5f1b9c1bddba677c5813fb2f8
Replaces relative path to absolute path in conf file generator

The $OUTPUTFILE value is broken if the base-dir is passed as . or ..
This patch replaces relative paths to absolute paths passed to base-dir and
adds validation to $BASEDIR/$PACKAGENAME.

Fixes bug #1204204

Change-Id: Iaec57b0e9a2d53e7a601fe551e6ec4fd55da24b7
Sample config file generator clean up

Removed obvious comments, variablized common values,
trimmed ouput messages.

Change-Id: Id28f9e1d861c99ace0a9d1f94672936c16cfe88f
Proper usage of _resource property in quotas

Use resources instead of _resources. This is necessary because _resources
actually does not contain all resources in VolumeTypeQuotaEngine, and there
is property-method `resources' was introduced for this.

Change-Id: Iac85497a956e7c3a8c58bb38337a63d0d5fabc8f
Use monkey_patch() in TestMigrationUtils setUp()

We use monkey patched sqlalchemy-migrate in
openstack.common.db.sqlalchemy.utils module. It allows us drop
unique constrains is SQLite.
If we run all tests, we also use `patched` migrate in
TestMigrationUtils(), but it patches in
`tests/unit/db/sqlalchemy/test_migrate.py` file. So tests from
TestMigrationUtils() class fails if we run them separately.

Added sqlalchemy-migrate monkey patch in setUp() method
TestMigrationUtils test class due to use `patched` migrate
in tests.

Fixes bug 1217306

Change-Id: I037ad36c1db3f88501f2b0f6ae9f2c946de1afa6
Modify SQLA session due to dispose of eventlet

Change openstack/common/db/sqlalchemy/session.py due
to use time.sleep() instead of eventlet.greenthread.sleep().
Function _greenthread_yield() renamed to _thread_yield().

Change-Id: I98987dc045ee5518ce0705213c5cec9b3aba8021
middleware: add notifier

This adds a middleware that sends a notification upon receipt of a
request.

Change-Id: Iead2431a5e3914a80125cedade2c6536328ee9d4
Blueprint: count-api-requests
add audit middleware

add audit middleware which appends open standard audit information
to the request environ and sends notifications using
middleware.notifier

blueprint support-standard-audit-formats

Change-Id: Ie67cf4a76ed5e177cdbb93a4c919a6ddf06ae49f
Modify lockutils.py due to dispose of eventlet

Change lockutils.py due to use threading.Semaphore instead of
eventlet.semaphore.Semaphore. Tests modified properly.

Change-Id: Ic3c5934577aff856ec71ba7e44b54aa963fda69c
Merge "Replaces relative path to absolute path in conf file generator"
Merge "Sample config file generator clean up"
Merge "Use monkey_patch() in TestMigrationUtils setUp()"
Merge "Modify SQLA session due to dispose of eventlet"
Merge "Modify lockutils.py due to dispose of eventlet"
Merge "Don't eat callback exceptions"
Merge "parameterize fileutils removal functions"
Merge "Proper usage of _resource property in quotas"