From 0c295153af55f85120c78875052bf5c23e168c4b Mon Sep 17 00:00:00 2001 From: Ruby Loo Date: Tue, 21 Apr 2015 19:07:32 +0000 Subject: [PATCH] Remove state transition: CLEANFAIL -> CLEANING The state machine incorrectly models the transition from CLEANFAIL to to CLEANING state. The spec [1] mentions that management of CLEANING tasks should be handled in the same fashion as ZAPPING tasks. For ZAPFAIL: Nodes that transition into ZAPFAIL will automatically enter maintenance mode, as failure to ZAP a machine usually indicates a hardware failure or something else that requires remote hands to fix. Nodes in CLEANFAIL should do a similar thing as ZAPFAIL; they are put in maintenance mode, but shouldn't be able to transition directly to CLEANING. This patch also clarifies the documentation for the transition CLEANFAIL -> MANAGEABLE. [1] http://specs.openstack.org/openstack/ironic-specs/specs/kilo/new-ironic-state-machine.html#proposed-change Change-Id: Ieda2fcd78332a063c51685cd01bb824014f0f4a8 Closes-Bug: #1446758 --- ironic/common/states.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ironic/common/states.py b/ironic/common/states.py index 7ebd052b6c..ab9684f320 100644 --- a/ironic/common/states.py +++ b/ironic/common/states.py @@ -262,11 +262,8 @@ machine.add_transition(CLEANING, AVAILABLE, 'done') # If cleaning fails, wait for operator intervention machine.add_transition(CLEANING, CLEANFAIL, 'fail') -# A node that fails cleaning may be put back through cleaning -machine.add_transition(CLEANFAIL, CLEANING, 'clean') - -# An operator may want to hold a CLEANFAIL node in operator for zapping or -# outside-of-Ironic operations (like replacing hardware) +# An operator may want to move a CLEANFAIL node to MANAGEABLE, to perform +# other actions like zapping machine.add_transition(CLEANFAIL, MANAGEABLE, 'manage') # From MANAGEABLE, a node may move to available after going through cleaning