Do not use __builtin__ in python3

__builtin__ does not exist in Python 3, use
six.moves.builtins instead.

Change-Id: I79b61b5ab67f491ce88015f799ff7d66c9eeb7ee
closes-bug: #1290234
Process public API list as regular expressions

In order to allow flexible patterns for public API specification
and to speed up the process of checking whether some request is
performed against the public API, it's reasonable to interpret the
list of public endpoints as regular expressions.

This patch changes the logic of checking whether a request requires
authorisation from searching the endpoint in the set to checking the
endpoint against a list of regular expressions.

Closes-bug: #1251880
Change-Id: I638ca0e20fa7e44fbeeae0d1e4c2f4188fb597a5
Permit passing SSH keys into the Ironic API

SSH keys are equivalent to passwords for the ssh driver, and having to
special case deployment metadata to push them out of band to a file is
awkward. This patch adds the ability to pass the key in directly which
is much easier (in some environments).

Change-Id: I4421c80cb3dc0c8aee614c684d113a7ab6db6779
Fix 'spacing' parameters for periodic tasks

conductor.manager module contains 'spacing' parameters for periodic
tasks, they do not work because manager module imported before
parsing config options.
There is not such problem in Nova which uses create() method in class
derived from common Service for lazy loading manager module.
Because this derived class not needed for Ironic simple load_manager
function added to common.service.

Partial-Bug: #1279774
Change-Id: Ib31024c8eaf75d38de09983459d86125847cdf30
Updated from global requirements

Change-Id: Ic5a504a6a3039b2aa1b9d7278f784778a13b279d
Adds max retry limit to sync_power_state task

* sync_power_state periodic task tries to set node's actual power state.
  In case of failure to sync power state, Ironic will keep trying to
  sync power state, Hence introduce a max retry per node
  sync power state limit
* Set Node's DB power state as the actual Node power state if max retries
  exceeded
* Set the Node's last_error msg after max retries exceed and set the
  node in maintainence mode

Change-Id: Idbd3afab746f81b9097e97afb1d12a81686a4564
Closes-Bug: #1285806
Pass no arguments to _wait_for_provision_state()

Commit 39e0a28d modified the inner function in destroy() to take
no arguments but its caller was not updated.  This avoids a TypeError
during Nova instance deletion.

Closes-Bug: #1296918
Change-Id: I865b1ef92b0a3736e0e6295892c663f7e4ab792e
Merge "Permit passing SSH keys into the Ironic API"
Speed up ironic tests

This change speeds up ironic tests by 60% by:
* Mocking eventlet.greenthread.sleep in a handful of tests
* Changing a time.sleep(2) to time.sleep(0.2) in a test where
  time.sleep is used intentionally for testing

Change-Id: I0cd2ae06549844ec3b76e7c91e1f49665ebc9717
Merge "Pass no arguments to _wait_for_provision_state()"
Fix missed exception raise in _add_driver_fields

There was a bug where the NovaException was not being raised in
the IronicDriver._add_driver_fields() method if the client update
call failed after the maximum number of retries.

Change-Id: Ic082079f35892cc2bf3fcad46cd33cebd1105608
Imported Translations from Transifex

Change-Id: If69eb05fc679aa1466bd185d5308338e6673415c
Remove logging of exceptions from controller's methods

WSME does exceptions logging in wsmeext.pecan via format_exception()
function. Logging exceptions in Ironic controllers code causes
duplicate messages in log.

Change-Id: Ie5a9856508127557714166d838f0e762e37a611d
Decrease running time of SeaMicro driver tests

Modify config options in SeaMicro driver unit tests for considerable
decrease running time.

Change-Id: I643e9ba6cf16e37a945b9017c59db96b80bb2270
Replace fixtures with mock in test_keystone.py

Change-Id: I83b5035c6919ced43cb4b39ae233976a3a06fa76
Update Neutron if mac address of the port changed

New method 'update_port_address' added to Ironic NeutronAPI.
This method used in conductor manager for update Neutron
when mac address of the port changed.

Closes-Bug: #1236714
Change-Id: I56a43a08de98868362ecef7ec5a8c740ed065120
Avoid API root controller dependency on v1 dir

This commit fixes the issue that pecan root controller
is dependent on files in v1 directory.

Change-Id: Id26db27b61094356ee02dbc7c5baa7e551a3cc5c
Partial-Bug: #1255954
Run ipmi power status less aggressively

Ironic runs IPMI 'power status' in a loop until the desired state is
reached. Running repeated IPMI commands in a tight loop (1 second sleep)
seems to occasionally cause 'insufficient resources' errors with some
hardware types.

In this commit we update the IPMI retry timer to use a
DynamicLoopingCall which can wait longer for each retry of the power
status command. We increase the wait time exponentially
between each call, until the total time would exceed the max retry time
on the next iteration.

This patch also removes the spurious initial 'power status' call which
preceeded the 'power on' or 'power off' call without any gap. Since
Ironic has a periodic task to sync the power state, it is safe to assume
that the hardware's current power state is already known and does not
need to be verified inside the set_power_state method.

As part of this change we also increase the default IPMI retry_timeout
config to 60 seconds.

Co-authored-by: Dan Prince <dprince@redhat.com>

Change-Id: Ie0e29239592bb64c7a10ecedae299df2c5053359
Closes-bug: #1291991
Merge "Updated from global requirements"
Update SeaMicro to use MixinVendorInterface

SeaMicro driver is now using the generic MixinVendorInterface
for the VendorPassthru driver interface

Change-Id: Iae8288d10fb9454a513a12b0c28add8b7504efd6