diff options
author | Daniil Baturin <daniil@vyos.io> | 2021-10-29 23:57:12 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-29 23:57:12 +0700 |
commit | 9d0d4b9d6dd2adaa80365d6049f643eac767395c (patch) | |
tree | 3487db66225e27f275088c2521eba56aa9022685 | |
parent | 4f4200f542c33e14d298cbdb2d12fe4f804188d9 (diff) | |
parent | 69655d3073f462b77133033ef1130f63e562efc3 (diff) | |
download | vyos-1x-9d0d4b9d6dd2adaa80365d6049f643eac767395c.tar.gz vyos-1x-9d0d4b9d6dd2adaa80365d6049f643eac767395c.zip |
Merge pull request #1055 from sever-sever/T3862
powerctl: T3862: Fix for reboot at 00:00
-rwxr-xr-x | src/op_mode/powerctrl.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/op_mode/powerctrl.py b/src/op_mode/powerctrl.py index a6188ec74..d4c6d47f7 100755 --- a/src/op_mode/powerctrl.py +++ b/src/op_mode/powerctrl.py @@ -97,7 +97,7 @@ def execute_shutdown(time, reboot = True, ask=True): elif len(time) == 1: # Assume the argument is just time ts = parse_time(time[0]) - if ts: + if ts is not None: cmd = check_output(["/sbin/shutdown", action, time[0]], stderr=STDOUT) else: sys.exit("Invalid time \"{0}\". The valid format is HH:MM".format(time[0])) @@ -105,7 +105,7 @@ def execute_shutdown(time, reboot = True, ask=True): # Assume it's date and time ts = parse_time(time[0]) ds = parse_date(time[1]) - if ts and ds: + if ts is not None and ds: t = datetime.combine(ds, ts) td = t - datetime.now() t2 = 1 + int(td.total_seconds())//60 # Get total minutes |