Sync config module from oslo

Add 'config' to openstack-common so that it syncs from Oslo,
move tools/conf -> tools/config to be able to sync from Oslo,
and then sync the changes which are proposed in oslo-incubator
commit Iee6cc05cad70963f2a151f595ac376c9338f5774.

Change-Id: I32a80b0e2aa0e26b9fc78b7546c07e102639374e
Remove copyright from empty files

According to policy change in HACKING:
http://docs.openstack.org/developer/hacking/#openstack-licensing
empty files should no longer contain copyright notices.

This patch aslo changes files in ironic/openstack/common, which
were changed in oslo https://review.openstack.org/#/c/64082/

Change-Id: I85fdbc2d94200b6e47ad7c9b8717d4578de2eaee
Closes-Bug: #1262424
Improve the node driver interfaces validation output

This patch improves the output of the node driver interfaces validation
to return the reason why the interface failed to validate.

The new structure looks like:

{'deploy':  {'result': True},
 'power':   {'result': False, 'reason': 'Invalid IPMI username'},
 'console': {'result': None, 'reason': 'not supported'},
 'rescue':  {'result': None, 'reason': 'not supported'}}

The patch also remove an unneeded log that was logging the errors for
each interface, every time the validation was called.

Change-Id: Id5d8aa1bd150b7d85f359471daccfacb6d9e2ede
Closes-Bug: #1263210
API to check the requested power state

API to make a sanity check on the requested power state, before the API
was just passing whatever state requested by the user via RPC to the
conductor and it would fail there in case the state request wasn't valid,
giving a late feedback to the user and wasting resources.

As the same check is done on the provision method, a new exception was
created to reuse the exception message.

The patch also update the docstrings of the power() and provision()
methods to reflect the exceptions they might raise.

Change-Id: I47f957f738ef922b01b2c604180d8b6efe20ce8c
Correct SSHPowerDriver validate() exceptions

Driver valdiate() method should raise only InvalidParameterValue
exceptions, which will be caught by
ConductorManager.validate_driver_interfaces().

The SSH driver was potentially raising a FileNotFound exception which
would be unhandled. This patch converts that into InvalidParamterValue.

Change-Id: I82d9776206c1391ba151614ac7512865f8ea672c
Merge "Improve the node driver interfaces validation output"
Enable $pybasedir value in pxe.py

We should not refer $pybasedir directly in our python code, because
it is loaded by paths.py, we should use paths.basedir_def("") to load
this $pybasedir value as a base path.

And change some 'nova' words to 'ironic in paths.py

Change-Id: I4c6bcb103d4d1eee8e7bf78f46c815630666cfe9
Closes-Bug: #1267351
Merge "Correct SSHPowerDriver validate() exceptions"
Merge "Remove copyright from empty files"
sync_power_states handles missing driver info

The ConductorManager._sync_power_states() periodic task will stop
checking power states if getting the power state of a node raises an
exception. Eg, this could happen if a node is not properly configured
(for which node.driver.power.validate() raises an exception).

With this change, sync_power_state catches the exceptions, logs them,
and continues checking other nodes.

Change-Id: I343f722de8f79a50fbaa9fcdd180decdc5a43f95
Closes-Bug: #1262912
Use correct auth context inside pxe driver

Until now, general auth context was used inside the pxe driver
making it fail when authenticating against glance. We should be using
instead task.context

Change-Id: I173b912c67ab77dda433d2f1f93e674852b7d054
Closes-Bug: #1266201
PXEAndSSH driver lacked vendor_passthru

Add vendor_passthru interface to PXEAndSSHDriver
to allow PXE-based deploys to continue.

Change-Id: Ief087f75b0b6975ed2b461f46cddcc9067316efe
Closes-bug: 1268066
Merge "Sync config module from oslo"
Merge "API to check the requested power state"
Implement consistent hashing of nodes to conductors

Implement the consistent hashing of nodes to conductors.

Implement automatic routing of RPC messages from the API tier to the
conductor tier, by using the consistent hash ring.

Improves _sync_power_states to only check the nodes mapped to that
particular conductor.

Add a stub for a rebalance method which can trigger certain actions by a
conductor when a node is mapped to it by changes in the hash
distribution.

blueprint instance-mapping-by-consistent-hash

Change-Id: Ib74a8ded49e4a85964c46d4a445ff0a2df39862a
Use same MANAGER_TOPIC variable

In ironic/conductor, manager.py and rpcapi.py both specify the variable
MANAGER_TOPIC = 'ironic.conductor_manager'.

They have to have the same value because this is the rabbit topic that
they communicate over. It would be less error-prone (and more obvious
that they should be the same), if it was only specified in one place.

Since cmd/conductor.py uses MANAGER_TOPIC from manager.py, rpcapi.py
was modified to do the same.

Change-Id: I5875ffb7548c1b5079ac4221ce1000ae620509d8
Closes-Bug: #1268810
Fix keystone get_service_url filtering

We are retrieving the services from keystone, so there
is no need to do filtering of the catalog, since we are
directly dealing with services endpoints.

Change-Id: I9a40207e2dee2e5bc268b9516daa74a3c6cf2352
Merge "PXEAndSSH driver lacked vendor_passthru"
Add RPC method for node maintenance mode

Method 'change_node_maintenance_mode' added to manager and rpcapi.
This method triggered maintenance mode for a node.
New column 'maintenance' added to nodes table.

Partial-Bug: #1260099
Change-Id: I945a1ce72c04e5ee2a9427a58dae72b0719c160f
Disallow new provision for nodes in maintenance

New deploy operation will not allowed for nodes in
'maintenance' mode.

Partial-Bug: #1260099
Change-Id: Idaf8c3d70bd78b2c95bbdcff734e235eb8063d91