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
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
Replace sfdisk with parted

Replace the current sfdisk which is broken with parted. This patch is
a short-term fix for the Icehouse RC1 release.

Closes-Bug: #1297925
Change-Id: I0c3763db0e29f58b33e998d1f7efb23337604960
Merge "Replace sfdisk with parted"
Fix Node object version

The IronicObject base class recently changed 'version' to 'VERSION', but a
patch to Node landed after it using the old attribute.

Change-Id: Ife139ae16314f5ea7bef83f36351f79e525f688b
Merge "Fix Nova rescheduling tear down problem"
Merge "Move duplicated _get_node(s)_mac_addresses()"
Merge "Fix Node object version"