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"
Merge "Move LockFixture into a fixtures module"
Merge "Raise an error if module import fails!"
Transform the for loop to expression

In python 3, if the dict is changed in the loop, there will
be following error:
RuntimeError: dictionary changed size during iteration

Transform the "for loop" to expression to avoid it:
- Use dict() to keep capatibility for old Python version.
- six.iteritems() to avoid the following error:
  ValueError: too many values to unpack

Finally, _code_map contains all the classes that have http_status
attribute.

Close-Bug #1240725

Change-Id: I169b13546bcd0d87353dbca5a9b64229b704fe66
Print the deprecated group/name for each option

In the config file generator, we should print the deprecated group
and name for each option if specified. This will help the users to
quickly find out what has changed.

Closes-Bug: 1223525

Change-Id: Ia4328b76ea626fd892a73ea6c4388203ef0b4b0e
Replace assert_ with assertTrue

The method assert_ has been deprecated since python 2.7.
http://docs.python.org/2/library/unittest.html#deprecated-aliases

This patch is a mere sed replace of one-liner assert_ to assertTrue.

grep -lR "assert_(" tests/* | \
xargs sed -ri 's/(\W+self.assert)_(\()(.+)(\)$)/\1True\2\3\4/'

Change-Id: Ic817bf32704adf2eb6ebbe67169625d65d49a9ad
Replace assertEquals with assertEqual

The method assertEquals has been deprecated since python 2.7.
http://docs.python.org/2/library/unittest.html#deprecated-aliases

Also in Python 3, a deprecated warning is raised when using assertEquals.

Change-Id: I667e41df786c842ecffc6920b80319fd8b3487a3
Merge "Replace assertEquals with assertEqual"
Merge "Replace assert_ with assertTrue"
Merge "Add urlopen/URLError/pathname2url in urlutils"
Drop RPC securemessage.py

The RPC securemessage stuff will eventually get integrated into
oslo.message. As is it is only partially complete in oslo-incubator
and it is getting synced into various projects (and breaking
some things).

Related-bug #1241634

Change-Id: Ie846dc01c20e44cc6cc4b4e910665f486749d317