Improve forbidden checks

New functions were created to check 'allowed' access because the previous design
was checking after changes were possibly made.

Changed the unit test to use an already created user to simulate the original
error that was reported.

Change-Id: I9f7e56a5afd9624070fffef6672ef88cd549f210
Closes-Bug: #1174451
Tests initialize database

Many tests (for example the backend_kvs tests) failed to run
individually. This is because the tests made the assumption that
because the system is configured for the KVS (or non-SQL) backend
that the database isn't required. The problem with this assumption
is that different backends can use different storage mechanisms,
and the credential backend only supports SQL. So any test that
requires that backends are loaded is required to initialize the
database.

Change-Id: I109b83bf512598952346bef01dc33c57802c7f60
Fix indentation errors found by Pep8 1.4.6+

As a preparation in order to switch to a newer
Pep8 version in the future, fix the indentation errors
that are missed by Pep8 1.4.5 due to bugs.

Change-Id: I19af0bdc9c3c9681a2bf60eb6d86f45c4fb11bc6
Closes-Bug: #1267994
Adds tcp_keepalive and tcp_keepidle config options

Currently the wsgi server will not close connections once requests
complete and will not enable keepalive on it's wsgi sockets. This can
be a problem for those who need to align the server keepalive with
load balancer timeouts without modifying system keepalive settings.

To remedy this we add new config options tcp_keepalive and
tcp_keepidle which are disabled by default to remain backwards
compatible.

DocImpact: "new config options for wsgi tcp_keepalive & tcp_keepidle"
Closes-bug: bug 1260406
Co-authored-by: Hirofumi Ichihara <ichihara.hirofumi@lab.ntt.co.jp>
Change-Id: Ic53402c57e1ebe44cde4c18e5e15200dcbbcb04b
Mock sys.exit in testing

If exit is called during subunit then it exits the subunit process which
makes the test suite fail with no information.

Change-Id: I7c189fad05f0d38c35e4014ff414d91841bc7632
Closes-Bug: #1276885
Remove default_notification_level from conf

This config option is used when you use the notify_wrapper wrapper
function from openstack.common. As we don't use the wrapper we don't
ever require the config option so we shouldn't show it to users.

blueprint oslo-messaging

Change-Id: I95280af37a84c71131fb2fc92c9302b8926c95bd
Merge "Fix indentation errors found by Pep8 1.4.6+"
Merge "Improve forbidden checks"
Merge "Tests initialize database"
Merge "Mock sys.exit in testing"
Merge "Adds tcp_keepalive and tcp_keepidle config options"
Merge "Remove default_notification_level from conf"