Add the timeout parameter to relevant methods in the fake power interface
In order to avoid a WARNING log such as: WARNING ironic.conductor.utils [req-99809e85-2cc0-4948-8665-7c5d3f1e5b47 - - - - -] The set_power_state method of fake doesn't support 'timeout' parameter. WARNING ironic.conductor.utils [req-0062c24d-36b4-447e-8823-cf3cc43752b9 - - - - -] The reboot method of fake doesn't support 'timeout' parameter. Over and over in the log files, this patch is adding the "timeout" parameter to the set_power_state() and reboot() methods of the fake power interface. Change-Id: I461e19c8552fe14bfa3e2c23f34bd37c83b8be22
This commit is contained in:
parent
96fde67102
commit
c44acd8c34
|
@ -43,14 +43,14 @@ class FakePower(base.PowerInterface):
|
||||||
def get_power_state(self, task):
|
def get_power_state(self, task):
|
||||||
return task.node.power_state
|
return task.node.power_state
|
||||||
|
|
||||||
def set_power_state(self, task, power_state):
|
def set_power_state(self, task, power_state, timeout=None):
|
||||||
if power_state not in [states.POWER_ON, states.POWER_OFF]:
|
if power_state not in [states.POWER_ON, states.POWER_OFF]:
|
||||||
raise exception.InvalidParameterValue(
|
raise exception.InvalidParameterValue(
|
||||||
_("set_power_state called with an invalid power "
|
_("set_power_state called with an invalid power "
|
||||||
"state: %s.") % power_state)
|
"state: %s.") % power_state)
|
||||||
task.node.power_state = power_state
|
task.node.power_state = power_state
|
||||||
|
|
||||||
def reboot(self, task):
|
def reboot(self, task, timeout=None):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,9 +65,6 @@ class FakeSoftPower(FakePower):
|
||||||
"state: %s.") % power_state)
|
"state: %s.") % power_state)
|
||||||
task.node.power_state = power_state
|
task.node.power_state = power_state
|
||||||
|
|
||||||
def reboot(self, task, timeout=None):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def get_supported_power_states(self, task):
|
def get_supported_power_states(self, task):
|
||||||
return [states.POWER_ON, states.POWER_OFF, states.REBOOT,
|
return [states.POWER_ON, states.POWER_OFF, states.REBOOT,
|
||||||
states.SOFT_REBOOT, states.SOFT_POWER_OFF]
|
states.SOFT_REBOOT, states.SOFT_POWER_OFF]
|
||||||
|
|
Loading…
Reference in New Issue