Removes use of timeutils.set_time_override

The set_time_override function in timeutils was written as a
helper function to mock utcnow for unittests before 'mock' was
generally used. Now that we have mock and fixture, we no longer
need to use it.

Change-Id: Ibcf6d4abee4a52bc459fc322e6a5268d39d70450
Partial-Bug: #1266962
Don't raise MySQL 2013 'Lost connection' errors

Although this code error is part of the `ping_listener` tests, it was
missing from the list of known - and ignored - connection errors.

The code error 2013 refers to a connection lost during a query, see:
https://dev.mysql.com/doc/refman/5.0/en/error-messages-client.html#error_cr_server_lost

Without this error code, the session won't try to reconnect to mysql,
which makes `max_retries` useless.

Closes-bug: #1276510
Change-Id: I27cad999b30a480ae23250150bfcba2668acabd7
Use six.StringIO/BytesIO instead of StringIO.StringIO

to keep Python 3.x compatibility, use six.StringIO/BytesIO to
replace StringIO.StringIO

StringIO works for unicode
BytesIO works for bytes

Change-Id: I0d1f8a55c3bc41379077b46feb81931779b7ad45
Partial-Bug: #1280100
Move ipmitool _set_boot_device to VendorPassthru

_set_boot_device must be exposed via vendor_passthru, allowing
operators to manually change it, and force to boot from net when
performing a pxe deploy.
Until now, it was just a private method of the power driver.

Partial-Bug: #1264596
Change-Id: I174f0a058bfe6276b7a42291661f3fd00de9a7ca
Sync Oslo service module to Ironic

New Oslo service code does correct stop Ironic conductor service from
screen session on devstack (screen -S stack -p ir-cond -X kill),
otherwise multiple conductors started on devstack after few
unstack/rejoin-stack cycles.

Change-Id: Ia8b4523e1288ca0817b94f85070f78237908a410
Supports OPERATOR priv level for ipmitool driver

This could be fixed by adding an optional member of node's
driver_info to store the privilege level. And add '-L' option for
ipmitool command call.

Change-Id: Ia3cb2ade8b6823a6d33db2fc22da940211c60b7d
Closes-Bug: #1263790
Merge "Move ipmitool _set_boot_device to VendorPassthru"
NodeLocked returns 503 error status

The NodeLocked exception status code was incorrectly set to 409
CONFLICT.  That status is (correctly) used by client-side errors, such
as MACAlreadyExists and InvalidState, which belong in the 4xx class of
HTTP error codes.

Instead, NodeLocked is a temporary server-side error and as such should
use the 503 error code, indicating that the client should re-issue the
request unchanged after waiting for the resource state to change on the
server side.

Change-Id: I00c6bac32ac7db068f49633a576422f9ca93cfef
Sync Oslo gettextutils  module to Ironic

Our ironic oslo gettextutils code is out of date, need to be updated.

Change-Id: I03d01f7ee6d710ad061f27fef0959b1c4d423408
Implements: blueprint i18n-messages
Fix test migrations for alembic

walk_revisions() method of alembic returns iterator which iterate
from upper to lower revision, therefore we need reorder results
for test migrations.

Change-Id: If05905408c4aebf607d003caf0fca220055df2f7
Add string representation method to MultiType

__str__() method added to MultiType class, otherwise we got default
representation in error message from WSME like 'Expected: ...
<ironic.api.controllers.v1.types.MultiType object at 0x357c8d0>}'

Change-Id: I9afb4deecd75ba50a43f5b222704d3911f87dfb4
Merge "Supports OPERATOR priv level for ipmitool driver"
Merge "Fix test migrations for alembic"
Use six.moves.urllib.parse instead of urlparse

To keep Python 3.x compatibility, use six.moves.urllib.parse to
replace urlparse.

Partial-Bug: #1279611
Change-Id: I271d492a501a2d2fce2980e11ce6f03b7b9f878a
Remove shebang lines from code

Need remove shebang lines like:
   #!/usr/bin/env python
from code

Change-Id: Id11cfcb9836a4908b96012f7bf413bc077a04a33
Partial-Bug: #1281055
Improve help strings

Better follow oslo.config style guide for consistent help strings:
* Capitalize help strings
* End help strings with "."
* Improve wording and capitalization.

Change-Id: Ib647bd85e636b16f1d1a040bb9ba04cd319a8826
Simplify locking around acquiring Node resources

task_manager.TaskManager and resource_manager.NodeManager were both
locking resources, but in different ways.

TaskManager used a DB-backed lock to guarantee cross-host exclusivity of
non-shared locks, even in the face of a conductor going offline.

NodeManager used lockutils.synchronized to guard creation of
instances of itself. For each node id, this class acted like a
singleton. Additionally, it kept references back to each TaskManager
which had acquired either shared or exlusive access to that Node. This
back-reference (and the related garbage collection) was not necessary
because most access was done within an exclusive lock context, and
therefor the benefit of resource caching was never realized.

This patch replaces NodeManager with a simple NodeResource class.  It is
now just a container to store and easily access objects associated with
a node, namely the node's port(s) and the node's driver object.

This patch also moves the driver loading out from NodeManager and into
TaskManager. As a result of this, significant refactoring of the unit
tests had to be done to mock the extension loading in a different way.

This patch updates the unit tests and module documentation accordingly.

Change-Id: Ic6fc1e198cd4979d3c4746db821ae959f42f4678
Do not use CONF as a default parameter value

In the HashRing.__init__() the "replicas" parameter defaults to
CONF.hash_distribution_replicas, the problem with this approach is
that Ironic might not have loaded the configuration at the time this
configuration is evaluated in the function definition. This patch fix
the problem by using a placeholder value instead of the configuration
option in the function definition.

Partial-Bug: #1279774
Change-Id: I5d8d7cd18a8a6b050f3aa448a337e0156e67ced5
Clarify and fix the dev-quickstart doc some more

Clarify and fix up the dev-quickstart doc some more
based on user feedback.

Testing examples now use tox rather than invoking the
testr command directly.

Simplified the section on building the documentation by
removing the need to install a web server.

Co-Authored-By: David Shrewsbury <shrewsbury.dave@gmail.com>

Change-Id: Ibdff4b44a26f11a5a0e92efb4c451105f6ab3245
Sync Oslo rpc module to Ironic

Our ironic oslo rpc code is out of date, need to be updated.
Related to blueprint send-data-to-ceilometer

List of changes:
fcf517d72cb81f972fad20caa9ff0341e9b4aa9c
Update oslo log messages with translation domains

7aa82452d0782355a0bf50d88e2d9a3625f9e000
Use Context Manager for reading JSON configs

a0948cb88d414e2a4b1a21340fcbfabfe8fa5aed
lockutils: remove local usage

22e971ac1103336a4859e9c7314ffc52d137405a
safe_log Sanitize Passwords in List of Dicts

8b2b0b743e84ceed7841cf470afed6a5da8e1d07
Use hacking import_exceptions for gettextutils
23f602940c64ba408d77ceb8f5ba0f67ee4a18ef
Use six.seraise() instead of `raise exc, val, tb`

ef406a21782134aeefb944f74b3f1a47d6169318
Create a shared queue for QPID topic consumers

e6494c2bcd52ae25744fe764b9f42cfdf7a6195e
Use six.iteritems to make dict work on Python2/3

e227c0ed7e0ed1f9b8d029336f8aeb60e38c23df
Properly reconnect subscribing clients when QPID broker restarts

16fb43b8b5d38998c690f35e3c21299d5b00550f
Replace data structures' attribute with six module

27b21bc95275a994c750c3f6bb145f4d0179cb55
Unify different names between Python2/3 with six.moves

4bfb7a2a772b40c3d4484876b27ec6f19c1a60a4
Apply six for metaclass

d7d74a752e34d5249fa47c8e8252da491d46012a
Add `versionutils` for version compatibility checks

3cdd157013881c7f1bf55dff0187f6531214e774
Add third element to RPC versions for backports

76972e2949634abe9fcc9ad36c103cca94300237
Support a new qpid topology

284b13adfb88018d58e0c7c4bfe840d1db1e8f6b
Raise timeout in fake RPC if no consumers found

7b0cb37c3015977e526a9473b7756a2fb1e852c8
Don't eat callback exceptions

69abf38814d71a111bb94b61963b93a421aab13d
requeue instead of reject

61c4cdec304d79f43c8a549c2543c939492c4812
Ensure context type is handled when using to_dict

223f9e101a24e403f9f252ecdfc0362ff3183ce2
Clarify precedence of secret_key_file

a035f95fef3944b3bf4d9ac5203726c72edb70c7
Don't shadow cfg import in securemessage

0f8857543b43a2f0e2c567603a0a24de61c31d45
Remove redundant global keyword in securemessage

848c4d530e0c3dd6493289b38366e08260d437ca
Some nitpicky securemessage cleanups

5c71c257e001b16e03ab78be4518736d5256c3bd
Allow non-use of cfg.CONF in securemessage

9157286d1e96246a44ba9891ec302e59a0e5c7be
RPC: Add MessageSecurity implementation

a047a353438d1e9449f94850b29d79bb2dd8f9b1
Make ZeroMQ based RPC consumer threads more robust

And updated ironic.conf.sample using new config generator.

Change-Id: I2200db850aecab912c4796c743c1e87fcb9327eb