summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-11-13 21:22:32 +0100
committerGitHub <noreply@github.com>2020-11-13 21:22:32 +0100
commit446d009c564e0c76e56ca1f78ef22a8b9b1b5819 (patch)
treebd04583764230342ff4bb9226fb48a37077a8711
parentd162d135a6e97b24f62148fd911c76bc15ff8bea (diff)
parentcdb55057dae966c108cfdffc3a0673cfc3862180 (diff)
downloadvyos-1x-446d009c564e0c76e56ca1f78ef22a8b9b1b5819.tar.gz
vyos-1x-446d009c564e0c76e56ca1f78ef22a8b9b1b5819.zip
Merge pull request #602 from DmitriyEshenko/fix-op-reboot
powerctl: T3066: Calculate minutes over 60
-rwxr-xr-xsrc/op_mode/powerctrl.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/op_mode/powerctrl.py b/src/op_mode/powerctrl.py
index 69af427ec..c000d7d06 100755
--- a/src/op_mode/powerctrl.py
+++ b/src/op_mode/powerctrl.py
@@ -34,7 +34,11 @@ def utc2local(datetime):
def parse_time(s):
try:
if re.match(r'^\d{1,2}$', s):
- return datetime.strptime(s, "%M").time()
+ if (int(s) > 59):
+ s = str(int(s)//60) + ":" + str(int(s)%60)
+ return datetime.strptime(s, "%H:%M").time()
+ else:
+ return datetime.strptime(s, "%M").time()
else:
return datetime.strptime(s, "%H:%M").time()
except ValueError: