diff options
author | Alexander Soldatov <a.soldatov@yadro.com> | 2018-10-31 14:29:31 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-12-06 13:16:13 +0000 |
commit | e32e33784a1883ee4528b17617df14f3114b0f5e (patch) | |
tree | 03fee41b3dc50a7bb6db73bd0741fc3d7c2cba26 | |
parent | a9427c85f386cdd452a33911893b3372f0068f3c (diff) | |
download | blackbird-skeleton-e32e33784a1883ee4528b17617df14f3114b0f5e.tar.gz blackbird-skeleton-e32e33784a1883ee4528b17617df14f3114b0f5e.zip |
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>
-rw-r--r-- | pychassisctl/chassis_control.py | 8 |
1 files changed, 2 insertions, 6 deletions
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 @@ class ChassisControlObject(DbusProperties, DbusObjectManager): 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 @@ class ChassisControlObject(DbusProperties, DbusObjectManager): 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 |