8ceaad42ff
Commit ee5d4942a1c33736ffe05ec01619142be400c2f4 changed the existing behavior so that if an ipmitool command fails when attempting to set the power state it causes a failure. The problem with that approach is that on some systems if the system is already in the desired power state, an error will be generated when ipmitool tries to change it to the desired power state. Now when doing a reboot command we check beforehand to see if the node is already off, if so then don't attempt to power off the node again. Also optimize ironic/conductor/utils.py node_power_action() so that it only checks a node's power status if it might perform an action based on the node's power status. Change-Id: If838aae871753ebfbdf359e0bbe3afcc54c4b559 Closes-Bug: #1718794