Enhance tests for LOG.deprecated

The tests for LOG.deprecated were incorrect because they were
clearing the log buffers on every call.

When this is corrected, it shows that LOG.deprecated is not working
as expected since it logs multiple times when the test indicates
that it should only log once.

Change-Id: Ic0e4925c372e5948c2140daa07ab3362fb25a306
Partial-Bug: #1266812
Fix deprecated messages sent multiple times

Calling LOG.deprecated('...') multiple times with the same log
message was causing the message to be logged multiple times. The
message should only have been logged once.

Change-Id: Ieab0bf2656761759966cf16f1de05bcb41cd1be5
Closes-Bug: #1266812
py3kcompat: remove

Everything is already in six>=1.4.0 and we already depend on such a
version. There's no reason to keep this file.

Change-Id: I06b90f789ae21f2ef8b8071b4298bfc0406482a6
Run tests in parallel as much as possible

The rpc unit tests have dependencies between tests that make it
impossible to run them in parallel right now, and because that
module is deprecated it doesn't make sense to spend a lot of
effort fixing the problems.  In order to test the other modules
in parallel, we now do two test runs: one in parallel for
everything but rpc, and one serialized for rpc.

Closes-Bug: #1272035

Change-Id: I85ae00b0180bb6fdc760c97882e4e7901e9db2ef
Implements SI/IEC unit system conversion to bytes

The issues with utils.to_bytes are

1) Ignores measure of unit and treats b and B both as Byte
2) Cannot handle SI unit system which base is 1000 (IEC=1024)
3) The name "to_bytes" didn't do a good job representing what the function does.
   Disscussed here,
       https://review.openstack.org/#/c/32093/2/openstack/common/strutils.py

This patch implements "string_to_bytes". The name comes from
"string_to_bool" in cinder/utils.py. Its merits are,

1) Handles bit and byte units
2) Handles SI and IEC unit systems
3) Has a much more intuitive function name

Closes-bug: #1189635
Closes-bug: #1193765

Change-Id: I5f1ce56f447179d1ef6ded7c956983151f5a8f18
Add etc/openstack.conf.sample to .gitignore

etc/openstack.conf.sample is generated when running the unit tests, so
add it ti .gitignore

Change-Id: Iee41f9f433c3cbe55a832a319564dfb90eec99b7
Merge "Implements SI/IEC unit system conversion to bytes"
Merge "Enhance tests for LOG.deprecated"
Merge "Fix deprecated messages sent multiple times"
Merge "py3kcompat: remove"
Merge "Add etc/openstack.conf.sample to .gitignore"
Fixture to reraise exceptions raised during logging

Add fixture to monkey patch logging.Handler.handleError to raise
exceptions generated when trying to emit a log.

Implements blueprint logging-handleerror-raise-exception

Change-Id: I7a4ab4f181634ed5b92ce88e9ed1d976ecb633a7
Don't store engine instances in oslo.db

oslo.db is meant to be a collection of helper utilities for
SQLAlchemy. In order to behave like a 'good' library, we must
stop using global state.

This patch ensures we don't store any engine instances globally in
oslo.db. It's up to end applications to decide how to cope with
engines, not oslo.db.

Partial-Bug: #1263908

Co-authored-by: Victor Sergeyev <vsergeyev@mirantis.com>

Change-Id: I330467ec1317e1a13ff9f0237e2d8900d718e379
Don't use cfg.CONF in oslo.db

Using of a global config object is something we want to avoid when
making libraries. Parameters must be passed as function/class methods
arguments instead.

In order not to duplicate options declaration in each project, they
have been put into separate options module (which should not be a
part of oslo.db when it's released; we'll probably want to find a
place for it within oslo-incubator).

Partial-Bug: #1263908

Co-authored-by: Victor Sergeyev <vsergeyev@mirantis.com>

Change-Id: Ib5a4e31b4e78e2b4cb807a8c88b8072f4207eb22
Merge "Fixture to reraise exceptions raised during logging"
Update status of modules moving to oslo.test

The test base class and some of the fixtures are moving
out of the incubator and into oslo.test, so they should
be frozen here for the time being.

Change-Id: I2965705d3c25c30cbc4ca522d58944073faee714
Use timestamp in periodic tasks

All time related data in periodic tasks are in seconds.
Therefore creating datetime objects only adds overhead to the module.
This patch replaces all datetime objects with utc timestamps in periodic_tasks.
Changes to test scripts were made accordingly.

Change-Id: I5bf77fba26aac62856fe30585577b7cf66dd6257
Refactor if logic in periodic_task

Currently we are checking twice whether spacing is None.
Since due-now is always smaller than spacing we can combine the two
if statements.

Change-Id: Icd354c8f9dd9988c9c985283abee7c852d2c13b2
Merge "Update status of modules moving to oslo.test"
Merge "Run tests in parallel as much as possible"