Virt driver change to use API retry config value

A hardcoded value of 10 seconds was being used for the sleep time
between looping ironic API calls. A TODO was left to use a configurable
value. This value exists in CONF.ironic.api_retry_interval so we
should use that.

Change-Id: Ieca4c987b765e226f3921efc24f0ec051f0b1094
Closes-Bug: #1314638
Fix 'pxe_preserve_ephemeral' parameter leakage

Add 'pxe_preserve_ephemeral' to the list of parameters to be removed
from the node when tearing it down to prevent it from leaking from one
deploy to another.

Closes-Bug: #1317527
Change-Id: I83811126ec72ce46290fb4828a05ef0bbc2c2fd2
Remove explicit dependency on amqplib

kombu already depends on amqp or amqplib depending on its
version, and no explicit access to amqplib exists in ironic code.

Update logging config to list both amqp and amqplib, as kombu
will setup one or the other.

Change-Id: I66b81e5ef13d009d01b7656fe5e61a7cffd7dcac
Remove non-existent 'pxe_default_format' parameter from patcher

The name of the parameter is 'pxe_ephemeral_format'.

Change-Id: Ibb642399b4dcdf3919214646ac43d1e16e66e8f0
Fix bad Mock calls to assert_called_once()

To actually check if a call was made, we should use
assert_called_once_with. assert_called_once is just a auto-spec'd
method and hence does not really check anything.

Change-Id: I64f902d3165d58e13c876d0184bf1d1ae4f81bae
Speed up Nova Ironic driver tests

Mock 'api_retry_interval' and 'api_max_retries' config values in
the Nova Ironic driver tests to avoid sleeps and make the tests run
quicker. Before on my machine those tests was taking ~10s to run,
mocking those values out make it run in 0.4s.

Closes-Bug: #1320907
Change-Id: I6c4fa400d0eadbcb10d1f8b937e2e707c91d6ea4
Don't translate debug level logs

Our translation policy
(https://wiki.openstack.org/wiki/LoggingStandards#Log_Translation) calls
for not translating debug level logs. This is to help prioritize log
translation. Furthermore translation has a performance overhead, even if
the log isn't used.

Related-Bug: #1318333

Change-Id: I0d6425fcf2c55d3cdab1dbfaa4bf698b1a33841c
Merge "Don't translate debug level logs"
Merge "Remove explicit dependency on amqplib"
Merge "Speed up Nova Ironic driver tests"
Merge "Fix 'pxe_preserve_ephemeral' parameter leakage"
Merge "Remove non-existent 'pxe_default_format' parameter from patcher"
Merge "Virt driver change to use API retry config value"
Factoring out PXE and TFTP functions

Multiple drivers need to support neutron and Ironic's PXE and TFTP
server. Factoring them out into a common file will make that
transition possible. I've moved all the generic calls into neutron
and reconfigured the PXE driver to work with the new functions.

Change-Id: I181ffabe673636b628329592e623e6425da54d6d
(cherry picked from commit 4ca638e71c2a0de26ea7c7ed593e12f4af57b423)
Adding a reference driver for the agent

This driver handles communication with the Ironic Python Agent's REST
API and controls the agent through the deploy and tear down process.
It utilizes the nodeless vendor driver passthru to communicate with
newly booted agents. Things not included yet are support for
Neutron, agent registration/discovery, and writing an image to the
drive before deploy is called.

The original source for this driver was on GitHub. For history,
check: https://github.com/rackerlabs/ironic-teeth-driver

Depends on:
https://review.openstack.org/#/c/81391/
https://review.openstack.org/#/c/81919/

Implements: blueprint agent-driver
Change-Id: Ic6ad8703304af3041c48e9ade32eccbffa78ec9c
(cherry picked from commit 0e6e0828eaf3b1674d9918435651c1cd41a264ab)
Drivers determine acceptable power states

The list of acceptable power states for a Node to be in when Nova is
calling deploy, update, and destroy were set globally.
This patch allows the deploy drivers to determine
which states are acceptable for each. I added a new validate
method to the DeployInterface class that can be overriden if
a driver determines it needs different settings (such as the agent
driver). The current function provides sane defaults and the
same behavior as before for any driver not overriding the function.

Change-Id: Iefec4396c323d9746bb0ee84b015765a4adbb476
Closes-Bug: 1306202
(cherry picked from commit a144b4499aab09c8b56cd8d757513f84d594d8d6)
Adding swift temp url support

This patch will allow properly configured Glance servers to return a temporary
URL for an object hosted on Swift. It will require Glance to use Swift
as its backend. A temporary URL will let the agent download an image from
Glance without requiring an auth_token, which gives access more than just
Glance. The easiest way to use it is to enable direct_url in Glance, but
you can set the appropriate config options to avoid needing to enable it.

We/I need to add a note in the docs about Swift being a possible dependency
for Ironic deploys using IPA, along with how to set the Temp URL key.

Swift perfomance concerns will be addressed in this blueprint:
https://blueprints.launchpad.net/ironic/+spec/improve-swift-agent-downloads

SecurityImpact
DocImpact

Implements: blueprint swift-temp-urls
Change-Id: I10e4784eee63e8edc9ba30a9c5004a08aa3a6d8e
(cherry picked from commit 327d32726dbc1d9a1ee97315a66210f76c8123f8)