Imported Translations from Transifex

Change-Id: Ie6300fae8c84bd25684a34001082423bef9c655a
Rename/update common/tftp.py to common/pxe_utils.py

The functions in the common/tftp.py are not related to TFTP, the
functions are PXE related and most of them are used to generate the
PXE configuration file. Moving it from tftp.py to pxe_utils.py will make
it less confusing and is also needed by the iPXE work since iPXE doesn't
generate any configuration file under the TFTP folder.

The dhcp_options_for_instance() method was updated to not receive the PXE
boot file image from the parameters and just get it from the configuration
because we were always using the value from the configuration anyway.

Implements: blueprint ipxe-boot
Change-Id: Icfbaa4d6cdb9cbe0c392bf3dbd50ad980c70560c
Import fixes from Nova scheduler reviews

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

- create BaseBaremetalHostManager class
- import and refactor the BaremetalHostManager
- refactor IronicHostManager
- minor updates to ExactMatch filters

Note that this change also adds back in copyright notices from
baremetal_host_manager to the ironic_host_manager to reflect
the common heritage of the code.

Change-Id: Iab0d0f1c05474bf341828a2e5aba95715bf71d82
SeaMicro to use the new ManagementInterface

Add the new ManagementInterface to the SeaMicro driver promoting the
set_boot_device() method from the VendorPassthru to the new interface.

The test_set_boot_device_no_input() test was removed because now inputting
a device is part of the function declaration.

Implements: blueprint new-management-interface
Change-Id: I2c5d0bba9045ce27c6b81ddefb6ca6bb019f2991
Implement retry on NodeLocked exceptions

This adds the capability to retry node locking when a node is already
locked. Two conductor configuration variables are added to control this
behavior, which can be totally disabled by setting the value for the
node_locked_retry_attempts variable to zero.

A new unit test is added to check that the retry will work after first
getting a NodeLocked exception, then succeeding getting the lock on the
next lock attempt.

Change-Id: I60b099beea1bc3a954a5ab4699e623aaa71ba6c5
Blueprint: add-nodelocked-retry
Merge "Import fixes from Nova scheduler reviews"
Merge "Rename/update common/tftp.py to common/pxe_utils.py"
Merge "Imported Translations from Transifex"
Merge "SeaMicro to use the new ManagementInterface"
Add drivers.base.BaseDriver.get_properties()

Adds ironic.drivers.base.BaseDriver.get_properties() which returns a
dictionary of <property>:<description> entries.

The driver interfaces (DeployInterface, PowerInterface, ...) have a
new get_properties() method that returns a dictionary of
<property>:<description>.

These changes are needed in order to provide an API to get driver_info
properties.

Change-Id: I5994e990deb26841633ca26de1a5fb63b743271a
Blueprint: get-required-driver-info
Partial-Bug: #1261915
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
remove ironic-manage-ipmi.filters

the two commands in this file doesn't need to
be executed as root, so this file can be removed

Closes-Bug: #1248422

Change-Id: I8a3b8b221a260a3a04ba8bbea59c60ed2fc1c8f8
Add a test case for DB schema comparison

Add a test case that allows to check if the DB schema obtained
by applying of migration scripts is equal to the one produced
from models definitions on MySQL and PostgreSQL.

Change-Id: I58e2cffd03396223c530d492cd18927c357b90e8
Merge "Implement retry on NodeLocked exceptions"
Merge "Add drivers.base.BaseDriver.get_properties()"
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