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"
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