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.
Reviewed: https:/ /review. openstack. org/84497 /git.openstack. org/cgit/ openstack/ ironic/ commit/ ?id=1b1d6b0cec6 4311ae62443b864 7fd528d3c91f1d
Committed: https:/
Submitter: Jenkins
Branch: master
commit 1b1d6b0cec64311 ae62443b8647fd5 28d3c91f1d
Author: Lucas Alvares Gomes <email address hidden>
Date: Tue Apr 1 16:16:02 2014 +0100
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 48a646ef6665b29 479277fb4d5
Co-Authored-By: Dmitry Tantsur <email address hidden>
Change-Id: I4c7037d6c7b995