Fix missing space in help text

The help text for the allowed_rpc_exception_modules is missing a
space.

Change-Id: I0b73f0c21277d1351f872b8b0e5046daee62cbf4
Replace using tests.utils part3

It is the last step to replace using tests.utils with
stack.common.test.
In this patch database tests is changed for using
openstack.common.test and added needed fixtures in test classes.

Blueprint: common-unit-tests
Change-Id: I9b360f9a8dc72bc3fb697e571555775bde10ef61
Fix to properly log when we release a semaphore

add a try/finally to ensure the LOG.debug is printed
properly. Currently the debug message is never executed

Change-Id: I8611567695c21c929ac6052e480ed733fba97f99
Related-Bug: 1235437
Merge "Adds common image utils"
Merge "Replace using tests.utils part3"
Don't override default value for eventlet.wsgi.server logging

We want eventlet.wsgi.server to use the same log level as everything
else (by default). For example if INFO logging is enabled eventlet.wsgi.server will
log all API requests. So if INFO logging is enabled in the API server we
want eventlet.wsgi.server to use the same log level.

This only changes a default value, and can be set by the user.

Change-Id: I42124793bbf542d69f6493bb3a9611e443775c2a
Merge "Don't override default value for eventlet.wsgi.server logging"
Merge "When translating if no locale is given use default locale"
Consolidate the use of stubs

We have two separate StubOutForTesting objects when running tests. One
that is instantiated directly in the moxstubout fixture and one that
mox has for itself.

When a method is stubbed, the overridden method is kept in a cache in
the StubOutForTesting instance. When calling UnsetAll() on this
instance, the order of the cache is reversed and the original methods
are put back in place. This means if you have SomeObject with a method
called actual_method and you stub that out with

    stubs.Set(SomeObject, "actual_method", fake_method)

you end up with a this tuple in the cache:

    (SomeObject, "actual_method", SomeObject.actual_method)

If you stub it out again

    stubs.Set(SomeObject, "actual_method", fake_method2)

this tuple is appended to the cache:

    (SomeObject, "actual_method", fake_method)

When calling UnsetAll(), the cache is reversed and becomes:

    [(SomeObject, "actual_method", fake_method),
     (SomeObject, "actual_method", SomeObject.actual_method)]

So first, SomeObject.actual_method (which currently is fake_method2) is
set to fake_method, and then set to the original
SomeObject.actual_method medthod.

If, however, you stub out the same method using both mox and our own
StubOutForTesting object, one of the caches will have

    (SomeObject, "actual_method", SomeObject.actual_method)

and the other will have:

    (SomeObject, "actual_method", fake_method)

At this point, restoring everything back to the original state depends
on these StubOutForTesting objects getting cleaned up in the correct
order. If it's done in the wrong order, SomeObject.actual_method
(currently set to fake_method2) will get reset to the original
SomeObject.actual_method and subsequently get "reset" to fake_method
which makes life miserable for subsequent tests that might rely on the
real implementation.

This change stops us from having two separate StubOutForTesting objects
by simply using mox's all the time.

Fixes bug #1239898

Change-Id: I3a768eca3432e6df09c87bd86bffa9763aabfbed
python3: Fix traceback while running tests

While running the testsuite with python3 results in the folowing
traceback:

RuntimeError: dictionary changed size during iteration

Change-Id: I11b9c1d96469de03494e18d17f10939c7e6fce66
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Use localisation

Change-Id: I1d0917f3a7df7a8bde02a1c91a4e84bb066060b7
Raise an error if module import fails!

Previously a missing module would cause the config file generator
to pass (mostly) silently with only a small message going to
stdout. If we can't import a module that seems like it is a bad
thing so lets just bail.

Change-Id: I391220e1344ba1785bf04654c7c5f52e2e8e82fc
Remove .pyc files before generating sample conf!

Updates the generate_samples.sh script so that we remove
.pyc files in the nova source tree before generating the sample file.

If you don't run unit tests the .pyc files won't get regenerated.
This can cause cryptic errors if you run tests, switch branches,
and then try to regenerate your config files if there are module
differences, etc.

Change-Id: I784a22c1cd7fb2c69ea1d9e02f87bd7da19d76aa
Use multiprocessing.Event to ensure services have started

ServiceRestartTest.test_terminate_sigterm would often fail in my Jenkins
instance. It turns out that sometimes the test case would manage to send
its SIGTERM after the signal handler is put in place, but before we
enter the "try: except" block in _wait_for_exit_or_signal. This meant
that the SignalExit exception isn't caught and makes the process
terminate with non-zero exit code. To verify this, you can add a
time.sleep(3) right after self.handle_signal().

To avoid this race condition, we add a ready_callback argument to
Service.wait() that gets called when entering the try-catch block.
In the test, we pass an Event object and wait for it to be set before
proceeding. This also gets rid of the questionable call to "ps".

Change-Id: I598e8bc889b6c2627a62271627d17b44e01acbe4
Skip bad versions of iso8601

0.1.7 is now released (https://pypi.python.org/pypi/iso8601). We
do need to allow folks to use the old 0.1.4 or the new  0.1.7 and
avoid the two bad versions (0.1.5 and 0.1.6)

Closes-Bug: 1241460

Change-Id: I96bfd8f27d9f7327c4c353c5f57660aabaa8c735
Merge "Remove .pyc files before generating sample conf!"
Merge "Use localisation"
Move LockFixture into a fixtures module

In Nova and other projects, fixtures are in test-requirements.txt and
NOT in requirements.txt so updating nova to use latest lockutils.py
is not possible. So let us move LockFixture out into it a separate
fixtures.py module where in theory we can add other fixtures as
well. See https://review.openstack.org/#/c/52153/ for an attempt to
try latest lockutils.py in Nova.

Change-Id: I12942d6390d06bb889d4145e708692fa886d99b5
Add urlopen/URLError/pathname2url in urlutils

They are used by heatclent and other projects.

Close-Bug #1242453

Change-Id: I0ff1afbafa78b2e91b7c0cf833f449c31debbe16
Merge "Use multiprocessing.Event to ensure services have started"