Clean up IronicNodeStates.update_from_compute_node

This method was needlessly wordy.

This patch does not change any functionality, merely makes the method
easier to read.

Change-Id: I7d66ea5e2146877f70a2e9060d3d4244f9493b9d
Fix Nova rescheduling tear down problem

If something fails in the spawn() method (e.g driver parameters, node
in maintenance mode) nova will try to rescheduler the instance (in case
the retry filter is enabled) as part of the rescheduling process nova
will call destroy() on that instance which was cause another problem
when Ironic tried to undeploy a node that wasn't deployed. This patch
is fixing the tear down problem by checking the provision_state of the
node before requesting Ironic to undeploy the node.

Also, the relevant code and tests underwent some refactoring to make
the code shorter and less nested.

Closes-Bug: #1300288
Co-Authored-By: Dmitry Tantsur <dtantsur@redhat.com>
Change-Id: I4c7037d6c7b99548a646ef6665b29479277fb4d5
Check that all po/pot files are valid

Perform minimal checks on po and pot files so that no broken files can
get imported.

Change-Id: I328fc11c688c16737ae88984e4778483ce5db5ab
Co-Authored-By: Clark Boylan <clark.boylan@gmail.com>
Related-Bug: #1298645
Improved coverage for ironic API

Added missing tests for get_one() in ironic.tests.api.*

Change-Id: I3d65441f4bf3857f40e856f692858e9b3ac19568
Fix spelling error in conductor/manager

maintenance was misspelled maintanence.

Found during translation.

Change-Id: I3a65a11f6337f3273dba0c01b36a41c30997d5e2
Merge "Check that all po/pot files are valid"
Open Juno development

Bump preversion to 2014.2 to formally open Juno development.
The Icehouse release branch (milestone-proposed) will be cut
from the last commit before this one.

Change-Id: Ifa98e88c4c78ef904b79da57a47195344ff4b3fb
Reduce logging output from non-Ironic libraries

The service logs (especially for conductor), are littered with
debug output from other libraries when run with DEBUG verbosity.
This makes it extremely difficult to read the logs. This turns
off the noisiest offenders.

Change-Id: Id779506a7bebe7c7a13fadaeac34807050d1ce04
Merge "Fix spelling error in conductor/manager"
Fix grammar in error string in pxe driver

Noted during translation, the string fixed here suffered
from a grammar error.

Change-Id: Ic0b0acf2ee10bef4536ec664accf5a8d9108ba09
Move duplicated _get_node(s)_mac_addresses()

Move duplicated _get_node(s)_mac_addresses() from pxe and ssh drivers
to a common place.

Change-Id: I27d1df6d3b63f3421d59d14d2b5b9f2c874d6580
Show maintenance field in GET /nodes

Before the maintenance field was only shown if client issued a GET on
a specific node (node-show), but this is an important attribute to have
listed in a GET /nodes (node-list), it's a good info to know which nodes
from that list are in maintenance mode or not, and the Nova Ironic Driver
also need this information to determine which nodes are available to be
exposed to Nova or not.

Change-Id: Icc31a312130a1c2d5853da64bd9091a93221363c
Merge "Improved coverage for ironic API"
Merge "Clean up IronicNodeStates.update_from_compute_node"
Fix self.fields on API Node object

All fields from objects.Node were being added to self.fields in
the API Node object. Because of this, when someone would POST, there'd
be an entry for {'id': None} in the dictionary passed to
dbapi.create_node(). We should only set fields we're exposing.

This also required fixing PATCH to not try to look at fields not set
on the API Node object when mapping to objects.Node.

A later patchset removes the direct dbapi call to create_node() in
flavor of using the objects.Node object where trying to set 'id' of None
would fail prior to this fix.

Change-Id: I92c03d9ff2a56e7999a685f9de38efec5aacbe47
Add Node.instance_info field

This is necessary for instance-level info accessed by drivers.

Related to blueprint add-node-instance-info

Change-Id: I4688676767a80ac6f1f3d571f0df4ea78bc756e1
Sync base object code with Nova's

This brings Ironic's base object code more in line with nova's since the
time it was copied. There's still a large difference in the field/type
declarations that we should resolve at some point. (Would be helpful if
this was in oslo, maybe. :)

A couple of these changes are needed for my future patchsets for object
cleanup.

Change-Id: I7e233fb448e9ce56f707d230dc5b2558bdb0a1f9
Change admin_url help in ironic driver

Replace ironic driver's admin_url ('Ironic pulic api endpoint')
with 'Kestoyne API endpoint.'

Change-Id: I3ac43251efff74001aa0e881c34a0c36eb2968ca
Closes-Bug: #1298077
Use xargs -0 instead of --null

This gives compatibility with OS X in the test.

Change-Id: I483b4279d0d6a5a6fe4f81b9fb07a838e17e1b0f
Merge "Fix grammar in error string in pxe driver"