Add flag to make baremetal.pxe file injection optional

File injection is slow and risky, So make it optional. File injection
was used for getting networking configuration into the baremetal nodes,
but neutron can do this now. File injection is also used for general
file injection and password injection, but those should be optional as
well.

Change-Id: If59641952255e5aaf3767524e2b3c566eefe2b74
Related-Bug: #1178103
Adds v3 API samples for hide server addresses and keypairs

Adds the v3 API samples for the hide server addresses and
keypairs extensions. Bundled together to reduce review load

Partially implements blueprint v3-api-specification

+DocImpact

Change-Id: If331d79a878af7543c8792ab4d675fc996c3cd04
Move call to _default_block_device_names() inside try block

During instance builds, a call to _default_block_device_names() is
made which contains a db call to update the instance. In case the
instance is gone it will throw an unhandled InstanceNotFound exception.

To properly handle this, move the call to _default_block_device_names()
inside the existing try block next to it that handles this exception.

Change-Id: I3503029f02669e6ae31441653096fa69cba76d45
Closes-Bug: #1224677
Fix v3 server rebuild deserializer checking with wrong access_ip key

When rebuild server with xml format, the xml deserializer code
are checking with wrong key. So rebuilding with access_ips doesn't
make any effect. So correct the wrong key 'access_ipv4', 'access_ipv6'
to 'access_ip_v4', 'access_ip_v6'.

Change-Id: I8fccf3727f193bf9142dc814a76a32d5ab1a1b0a
Closes-bug: #1221646
Fix V3 API flavor returning empty string for attributes

Fixes cases where in the V3 API the ephemeral, swap and vcpus
attributes for flavors were returned as the empty string
when they had a value of 0. Also removes default setting for
the disabled attribute as it is always set in the db.

Fixes up some associated testcase data as it was using data which
could not exist in the db.

Change-Id: I90f48956411f792037b1cd744c4fa8d287f9e752
Closes-Bug: #1216929
Adds V3 API samples for srvcs, tenant usage, server_diagnostics

Adds V3 API samples for the services, simple tenant usage and
server_diagnostics extensions. Bundling them together to save
on review load

Partially implements blueprint v3-api-unittests
Partially implements blueprint v3-api-specification

Change-Id: I91edc6500acbe92221427383b4bcd3d00a8faadd
Forced scheduling should be logged as Audit not Debug

Forced scheduling to a node is a privileged operation which bypasses
resource checks. As such the log entries should be Audit not Debug

Fixed Bug: 1231983

Change-Id: Id2016b7bf2ba5f7af4896b5f8df481437d2ee956
baremetal: Fix misuse of "instance" parameter of attach/detach_volume

Some parts of baremetal driver treat "instance" parameter as if it is
the name of an instance, but actually it is the instance itself (dict).

Closes-Bug: #1221244
Change-Id: I01a296a6ac0bbf7c5fec3434ddf1197828b849b6
Remove `utils.timefunc` function

This is not used anywhere.

Change-Id: I189d9e45a91df42726048942e908e39872435872
Fix races in v3 cells extension tests

A global was used for a cell list and tests would update this global
and fail depending on order run, etc.

Yes, this is the same fix as commit bb2c3c5 except for the v3
extension. Yes, copied and pasted code is utterly evil. No, we
apparently will never learn.

Closes-Bug: #1235399
Change-Id: I3406d0440aed38cbf3a9bedf24420fb867876b08
Fix docstring for disk_cachemodes

The docstring for the disk_cachemodes option implied a syntax that is
incorrect for a ListOpt.  Change the example to match exactly what you
would put in the config file for it to work.

Change-Id: Ie999d2799dba6c47facdc771e1cf6081d28d6b85
Closes-Bug: #1106423
Merge "baremetal: Fix misuse of "instance" parameter of attach/detach_volume"
Merge "Move call to _default_block_device_names() inside try block"
Baremetal: Be more patient with IPMI and BMC

Before we called 'power status; power on' in a loop which made the
IPMI/BMCs not behave well.  Also the total time we would wait (2.5
seconds wasn't always enough).  So make sure power on/off is only called
once and wait up to 10 seconds for the power state change to go into
effect.

This patch has been tested on real baremetal using
https://wiki.openstack.org/wiki/TripleO/TripleOCloud

This bug is also linked to ironic so the change will be made there as
well.

Change-Id: I5a4d7c84ebdf9c1f7d8d0570dbc31764c31f1fc6
Closes-Bug: #1234479
Merge "Adds V3 API samples for srvcs, tenant usage, server_diagnostics"
Merge "Adds v3 API samples for hide server addresses and keypairs"
Merge "Fix V3 API flavor returning empty string for attributes"
Merge "Add flag to make baremetal.pxe file injection optional"
Merge "Remove `utils.timefunc` function"
Merge "Fix races in v3 cells extension tests"