WOL driver - include POWER_OFF in supported power states

The WakeOnLanPower class is designed to POWER_ON using WOL and log
REBOOT/POWER_OFF operations as they require manual intervention.

However the POWER_OFF state was mistakenly omitted from
get_supported_power_states, which results in an error instead of a log entry.
Introspection on tripleo fails as a result of this.

Story: #2005292
Task: #30162
Change-Id: I34ee6da8600d6e6107f00732bf1c34c5b745b333
This commit is contained in:
Oliver Walsh 2018-05-17 14:33:04 +01:00 committed by Dmitry Tantsur
parent 0e1be8bb81
commit 88e85766c6
2 changed files with 9 additions and 2 deletions

View File

@ -211,4 +211,11 @@ class WakeOnLanDriverTestCase(db_base.DbTestCase):
with task_manager.acquire(
self.context, self.node.uuid, shared=True) as task:
pstate = task.driver.power.get_supported_power_states(task)
self.assertEqual([states.POWER_ON, states.REBOOT], pstate)
self.assertEqual(
[
states.POWER_ON,
states.POWER_OFF,
states.REBOOT
],
pstate
)

View File

@ -198,4 +198,4 @@ class WakeOnLanPower(base.PowerInterface):
:returns: A list with the supported power states defined
in :mod:`ironic.common.states`.
"""
return [states.POWER_ON, states.REBOOT]
return [states.POWER_ON, states.POWER_OFF, states.REBOOT]