Improve exception handling in console code

Drivers should only be raising IronicExceptions, but ipmitool, via
the console-related code, was raising non-IronicExceptions. This adds a
'ConsoleError' exception, changes the other console-specific exceptions
to inherit from ConsoleError, and refactors the code a bit to only raise
IronicExceptions.

More unit tests were added.

Change-Id: I1660525646a4ce39f1fbc690a61e63e6f1b368b9
Partial-Bug: #1267693
Remove objectify decorator from dbapi's {get, register}_conductor()

This patch removes the objectify decorator from the get_conductor and
register_conductor dbapi's methods.

For get_condutor() method there's an objects interface to it so this patch
make the code/tests use the object interface vs direct calls to dbapi.

The problem with the objectify decorator is that dbapi methods
doesn't get the context, so when forming the RPC object using the
decorator we can't store the context within the object (which is what
we want to do to have consistent object interfaces).

Partial-Bug: 1314732
Change-Id: I1a955a59435b35277f3bbff2c02c07dd1a4c1d66
Handle all exceptions from _exec_ipmitool

_exec_ipmitool() could raise a non-IronicException because
_make_password_file() was raising any Exception. This changes
_make_password_file() to raise exception.PasswordFileFailedToCreate
and changes the rest of the code that calls _exec_ipmitool() to
handle the specific IronicExceptions instead of any Exception.

Partial-Bug: #1267693
Change-Id: I1668dcdd5a5a369df4dbc86a39ae66615039acdd
Replace incomplete "ilo" driver with pxe_ilo and fake_ilo

The "ilo" driver is not complete -- it only has a PowerInterface today.

This patch removes it from setup.cfg, deletes the drivers/ilo.py module,
and adds both PXEAndIloDriver and FakeIloDriver instead.

Change-Id: I431fd5155d0696a0a48ad8decf9f5317c5fcd7a2
Removes get_port_by_vif

VIF is not indexed by the databse, it lives inside the extra attribute
which is a data blob, so the method is not used.

Change-Id: I11ce35bae1aa81c38c8ebc87251148ae65f3a30e
Partial-bug: 1314732
Add docs for agent driver with devstack

This allows users to run Ironic with the agent driver in devstack.

Change-Id: I9703041bde6bd1c5f19b1c732cda7e7b025aa8c1
Merge "Replace incomplete "ilo" driver with pxe_ilo and fake_ilo"
Merge "Removes get_port_by_vif"
Remove d_info param from _destroy_images

A d_info dict was being passed to _destroy_images but wasn't used. Remove it and update calls to it. 

Change-Id: I6e50e58237d1b29b5234730099344ac432671b09
Merge "Remove d_info param from _destroy_images"
Fix tear_down a node with missing info

When tearing down a node, there could be some situations where the
instance info is missing some properties (image source deleted before
tearing down the node), so skipping node info validation. Instead,
perform a power validation to assure that the node can be power
managed.

Closes-Bug: #1335909
Closes-Bug: #1345334
Change-Id: Idb1ca720bbd19de1fccfe049e592136dbca2aacf
Fix py3k-unsafe code in test_get_properties()

This changes the unit test test_get_properties() so that it is
py3k-safe.

This is a follow-up to a comment in review 107092:
https://review.openstack.org/#/c/107092/8/ironic/tests/drivers/test_ipmitool.py

Change-Id: I3fc1c9962d02516aa09b8c22f5c1f940a2173703
Merge "Remove objectify decorator from dbapi's {get, register}_conductor()"
Merge "Add docs for agent driver with devstack"
Updated from global requirements

Change-Id: I71ce5c6e67e61a466f42343a15bcfb9f01d1873d
Merge "Fix tear_down a node with missing info"
Update DevStack guide when querying the image UUID

The command to query the UUID of the default image to be deployed
was retuning more than one UUID because of a grep problem, that would
also cause the "nova boot" command to fail because it was passing more
arguments that expected.

This commit fix the regex to query the UUID of the image by ignoring
what comes after the name of the image.

Change-Id: I03ad610fdd3313977b61d0d82bd1b33811f7ece1
Update compute driver macs_for_instance per docs

Updates the docstring for the macs_for_instance method
to match the documented Nova driver.

Also updates the method to return values per the docs.

Change-Id: I87f36ab675f57137f46416fa810eda5662d92ee0
use MissingParameterValue exception in iboot

The iboot driver raises InvalidParameterValue exception in _parse_driver_info() when any required parameters are missing. It should be raising
MissingParameterValue instead.

Change-Id: I7e8955712c0ef0166a1b4daf1008579413fdfcb1
Closes-Bug: #1358758
IPMI double bridging functionality

Enables ipmitool bridging functionality in ironic

In ipmitool there are two different bridging argument specifications:
* single bridge (-t <target_address> [-b <target_channel>])
* double bridge (-T <transit_address> [-B <transit_channel>])
one can also specify the local IPMB address using -m <local_address>

When registering an baremetal node which requires bridging, the
appropriate parameters should be specified to ironic IPMI power
driver as follows:
-i ipmi_bridging=<single/dual/no>
-i ipmi_local_address=<value>
-i ipmi_transit_channel=<value>
-i ipmi_transit_address=<value>
-i ipmi_target_channel=<value>
-i ipmi_target_address=<value>

The parameter 'ipmi_bridging' should specify the type of bridging
required(single/dual) to access the baremetal node.
If the parameter is not specified, the default value will be set
to "no"

  Single Bridging:
    ironic node-create -d pxe_ipmitool [-i ipmi_local_address=VALUE]
    <-i ipmi_bridging=single> <-i ipmi_target_channel=VALUE>
    <-i ipmi_target_address=VALUE> ...

  Double Bridging:
    ironic node-create -d pxe_ipmitool [-i ipmi_local_address=VALUE]
    <-i ipmi_bridging=dual>  <-i ipmi_transit_channel=VALUE>
    <-i ipmi_transit_address=VALUE>  <-i ipmi_target_channel=VALUE>
    <-i ipmi_target_address=VALUE>  ...

The parameter 'ipmi_local_address' is optional. If the
parameter is not specified, it is auto discovered by ipmitool

Implements blueprint enabling-ipmi-double-bridge-support

Change-Id: I78e024a6205b0a87e50fbf0d93e69ef415be0934