Prevent the reboot command from powering on the host.
Pushing reset button or sending reboot command
should not power on the host if it was off.
Change-Id: I9e307e7b5d181f94bed7176baad23a95920ed8b2
Signed-off-by: Alexander Soldatov <a.soldatov@yadro.com>
diff --git a/pychassisctl/chassis_control.py b/pychassisctl/chassis_control.py
index 2a6f175..fbe0f72 100644
--- a/pychassisctl/chassis_control.py
+++ b/pychassisctl/chassis_control.py
@@ -119,9 +119,7 @@
in_signature='', out_signature='')
def reboot(self):
print("Rebooting")
- if self.getPowerState() == POWER_OFF:
- self.powerOn()
- else:
+ if self.getPowerState() != POWER_OFF:
self.Set(DBUS_NAME, "reboot", 1)
self.powerOff()
return None
@@ -130,9 +128,7 @@
in_signature='', out_signature='')
def softReboot(self):
print("Soft Rebooting")
- if self.getPowerState() == POWER_OFF:
- self.powerOn()
- else:
+ if self.getPowerState() != POWER_OFF:
self.Set(DBUS_NAME, "reboot", 1)
self.softPowerOff()
return None