From 69655d3073f462b77133033ef1130f63e562efc3 Mon Sep 17 00:00:00 2001 From: Viacheslav Date: Fri, 29 Oct 2021 16:45:58 +0000 Subject: powerctl: T3862: Fix for reboot at 00:00 --- src/op_mode/powerctrl.py | 4 ++-- 1 file 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 -- cgit v1.2.3