Implement API to get driver properties

Implement GET /v1/drivers/<driver>/properties that returns a
dictionary of (driver_info) properties of the specified driver.
Each entry in the dictionary is:
  key: name of the property
  value: description of the property

An invalid driver name results in an HTTP 404.

Eg: 'GET /v1/drivers/pxe_ipminative/properties' returns:
{"pxe_deploy_ramdisk": "UUID ... of the ramdisk... Required.",
 "ipmi_username": "IPMI username. Required.",
 "ipmi_address": "IP of the node's BMC. Required.",
 "ipmi_password": "IPMI password. Required.",
 "pxe_deploy_kernel": "UUID ... of the deployment kernel. Required."
}

If the properties for a driver are not cached, the API service makes
an RPC request to a conductor to get the properties for that driver.
It then caches that information for subsequent requests of that driver.

Change-Id: I9c98f4369c54a7cdf9e20ea87348e61f7af10303
Blueprint: get-required-driver-info
Partial-Bug: #1261915
Catch oslo.db error instead of sqlalchemy error

The latest oslo.db code wraps all sqlalchemy exceptions and re-raise
them as oslo.db exceptions. But there is a single case in Ironic when
we suppose to get sqlalchemy exception, so this will break unittest,
when the new version of oslo.db will come.

Added check for the new oslo.db exception, left the old check for the
compatibility.

Closes-Bug: #1214341
Change-Id: Iae5599948d29778ac416edf31d3b1b2f7a8a54a9
Backporting nova host manager changes into ironic

Some very trivial pep8 fixes need to go back into the ironic tree
in case of future round-trip revisions.  This patch just backports
then so they won't be forgotten.

Change-Id: I6142c5fa9d06462c1cda863b0d32ced6f06ac66a
IPMINative to use the new ManagementInterface

Set the new ManagementInterface to the IPMINative driver. As the only
vendor method of the IPMINative driver was the set_boot_device, the
vendor interface is not needed anymore and was removed.

Also, before the 'persistent' parameter of the _set_boot_device() method
was ignored, this patch is fixing it.

Implements: blueprint new-management-interface
Change-Id: I4f3d13f1e0bebda011b3bfbb71ecd7507ca44c39
Fix nodes left in an incosistent state if no workers

This patch is fixing the problem of leaving the nodes in an inconsistent
state if there's no free conductor workers available to deploy or the
tear down a node, the patch is using the set_spawn_error_hook() method
of TaskManager to run some custom code that will rollback the nodes
to the previous provision_state and target_provision_state in case
NoFreeConductorWorker is raised.

Closes-Bug: #1331494
Change-Id: I5d6e8e2c69cbdf1f9abe169afe617aa79783e57d
Generalize exception handling in Nova driver

We need to ensure nodes get unprovisioned and disassociated from instances upon
all failure cases, not only the specific exceptions being caught now.  This
removes the catching of those specific exceptions during instance spawn and
performs required cleanup and re-raising.

Change-Id: I9461139400d7aa0a339550cf89f3d49e3a8cb2c0
Merge "Generalize exception handling in Nova driver"
Merge "Backporting nova host manager changes into ironic"
Merge "Implement API to get driver properties"
Import fixes from the Nova driver reviews

Import fixes from the Nova driver review, based upon revision 7
of https://review.openstack.org/#/c/103167/

- better use of _L* helpers
- dynamically import python-ironicclient when the driver is initialized,
  so that Nova does not need to add it to requirements.txt
- remove unused CONF options pxe_bootfile_name
  and instance_type_extra_specs

Co-authored-by: Devananda van der Veen <devananda.vdv@gmail.com>

Change-Id: Iee1481632e9927766776c7d35264e8cf4c469c8a
Merge "Catch oslo.db error instead of sqlalchemy error"
Merge "Fix nodes left in an incosistent state if no workers"
Merge "Import fixes from the Nova driver reviews"
Merge "IPMINative to use the new ManagementInterface"