diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-11-13 21:22:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-13 21:22:32 +0100 |
commit | 446d009c564e0c76e56ca1f78ef22a8b9b1b5819 (patch) | |
tree | bd04583764230342ff4bb9226fb48a37077a8711 /src/op_mode/powerctrl.py | |
parent | d162d135a6e97b24f62148fd911c76bc15ff8bea (diff) | |
parent | cdb55057dae966c108cfdffc3a0673cfc3862180 (diff) | |
download | vyos-1x-446d009c564e0c76e56ca1f78ef22a8b9b1b5819.tar.gz vyos-1x-446d009c564e0c76e56ca1f78ef22a8b9b1b5819.zip |
Merge pull request #602 from DmitriyEshenko/fix-op-reboot
powerctl: T3066: Calculate minutes over 60
Diffstat (limited to 'src/op_mode/powerctrl.py')
-rwxr-xr-x | src/op_mode/powerctrl.py | 6 |
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: |