Fix message preventing overwrite the instance_uuid

If a node already has an instance associated with it, we prevent
the instance_uuid from being updated (one should tear-down the node
first). When trying to update the instance_uuid the message returned
was saying that the node was associated with the new instance value,
this patch fix the message to return the current instance_uuid associated
with the node.

Change-Id: Ib8ab6c96b28b49b6259a95e82c83c5fbdeba5f91
Closes-Bug: #1308144
Add DiskPartitioner

DiskPartitioner is a convenient wrapper around the parted tool, this
wrapper will make things easier for fixing other problems in Ironic like
removing the swap partition if not specified, having a more consistent
partition layout or future work like creating GPT (GUID Partition Table)
partitions (needed for creating partitions with size bigger than 2TB),
efi partitions, etc..

Change-Id: I44be217d1e55778ed94f27603ce0537ff740febf
Partial-Bug: #1297925
Partial-Bug: #1298362
Merge "Fix message preventing overwrite the instance_uuid"
Refactor sync_power_states tests to not use DB

DB calls are tested separately, so using the DB in tests is unnecessary.
This also adds some better call argument checking and some missing test
cases.

Refactoring this here saves a couple of future patches from having to
include a ton of changes to these tests.

Change-Id: Id5622099db689cde2c685c203323de1ea20b70b0
Make sync_power_states yield

The sync_power_states periodic task can run for a long time, so it needs
to yield to other greenthreads. Adding yielding increases the chances
for race conditions, however.

So for every node returned from get_nodeinfo_list, we re-fetch and check
the states again, because they may have changed. Also, check the states
yet again after acquiring a lock. This can be fixed at some point by
allowing constraints to be passed when acquiring a lock. I've noted
this with a FIXME.

Also, when querying the Node, use the integer ID instead of the UUID,
because it's slightly more efficient.

Change-Id: Ie4d3f896e32b58378bfeb5ff457a9bfe6a8d065f
Merge "Add DiskPartitioner"
Update ironic.conf.sample

Update ironic.conf.sample due to changes in keystoneclient

Change-Id: I387ed02c50532527c41d12964c212b0cd9201fad
cleanup docstring for drivers.utils.get_node_mac_addresses

Change-Id: Id31ad06b2c44695d187138b32513b20120855302
Closes-Bug: 1306210
Better handling of missing drivers

Instead of loading all available drivers, this patch adds add a CONF
option for "enabled_drivers" which explicitly sets the expected drivers.
A failure to load an enabled driver will prevent the conductor service
from starting.

Use a callback hook in stevedore to capture and clean up import exceptions.
Third-party drivers are expected to use importutils to attempt to load
their external requirements, and when unable to, they should raise a
DriverNotFound error to tie into this hook.

Sets the default enabled drivers to:
- pxe_ssh
- pxe_ipmitool

tests/api/v1/test_ports was creating a ConductorManager instance
instead of appropriately mocking the conductor.rpcapi, which led to test
failures when changing how ConductorManager loads drivers. This patch
corrects this by properly mocking the rpcapi within that test class.

Change-Id: I2da37409cea98731a2ca18dfe7298861fde37783
Closes-bug: #1298529
Closes-bug: #1302562
Use DiskPartitioner

Use the new DiskPartitioner class to create the partition layout.

This commit also moves the sleep() workaround to avoid the "device is
busy" problem into the DiskPartitioner wrapper.

Change-Id: I28bb17c7ce2262d3088f58ab4421145e8d9baa1f
Closes-Bug: #1297925
Merge "Refactor sync_power_states tests to not use DB"
Merge "Make sync_power_states yield"
Merge "Use DiskPartitioner"
Add worker threads limit to _check_deploy_timeouts task

New nodes filter parameters added to db.sqlalchemy.api. This
parameters used in _check_deploy_timeouts periodic task for
limit of worker threads which can be started simultaneously.
New config option 'periodic_max_workers' added to conductor
group.

Closes-Bug: #1285793
Change-Id: I646540e334dec05682640c05cedb315e0ee355bc
Complete wrapping ironic client calls

This makes all ironic client calls use the new client wrapper that
encapsulates the retry logic.

Change-Id: I3dcbacee4c88704b8c2553a2f39cbcc32e8c306e
Closes-Bug: #1295870
Closes-Bug: #1307589
Modify the get console API

Changed the return value of the console GET api from string to
the following JSON object:
{'console_enabled': True, 'console_info': {'type': 'shellinaboxd',
   'url': 'http://<hostname>:<port>'}} for the node with console
enabled.
{'console_enabled': False, 'console_info': None} for the node
with console disabled.

Change-Id: I6c5818052e18ddfbcc148a18976ba5873b644039
Closes-Bug: 1307555
Implement list_instance_uuids() in Nova driver

This implements the list_instance_uuids() in the Nova
driver to help the compute manager more accurately track
instances running in an Ironic cluster.

Change-Id: I00978ea9622a2c15a6b2513bb11d695e7cab5572
Merge "Implement list_instance_uuids() in Nova driver"
Merge "Modify the get console API"
Merge "cleanup docstring for drivers.utils.get_node_mac_addresses"