diff options
Diffstat (limited to 'ironic/conductor/utils.py')
-rw-r--r-- | ironic/conductor/utils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ironic/conductor/utils.py b/ironic/conductor/utils.py index cdf3a99ee..402ec2241 100644 --- a/ironic/conductor/utils.py +++ b/ironic/conductor/utils.py @@ -297,6 +297,13 @@ def node_power_action(task, new_state, timeout=None): node = task.node if _can_skip_state_change(task, new_state): + # NOTE(TheJulia): Even if we are not changing the power state, + # we need to wipe the token out, just in case for some reason + # the power was turned off outside of our interaction/management. + if new_state in (states.POWER_OFF, states.SOFT_POWER_OFF, + states.REBOOT, states.SOFT_REBOOT): + wipe_internal_info_on_power_off(node) + node.save() return target_state = _calculate_target_state(new_state) |