diff options
author | Daniil Baturin <daniil@baturin.org> | 2019-12-09 23:45:57 +0100 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2019-12-09 23:45:57 +0100 |
commit | a68d72122c3cc032b5a7b05dafc0578e64244c4f (patch) | |
tree | 2a013ba5361f29a5ff0112c1ca65078e934a605e /src | |
parent | be09f1ec2bbc2ba23c718b01a5f3b52dde44695f (diff) | |
download | vyos-1x-a68d72122c3cc032b5a7b05dafc0578e64244c4f.tar.gz vyos-1x-a68d72122c3cc032b5a7b05dafc0578e64244c4f.zip |
T1855, T1826: Restore support for reboot/poweroff in M minutes.
Diffstat (limited to 'src')
-rwxr-xr-x | src/op_mode/powerctrl.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/op_mode/powerctrl.py b/src/op_mode/powerctrl.py index 8de25d752..a6188ec74 100755 --- a/src/op_mode/powerctrl.py +++ b/src/op_mode/powerctrl.py @@ -27,7 +27,10 @@ from vyos.util import ask_yes_no def parse_time(s): try: - return datetime.strptime(s, "%H:%M").time() + if re.match(r'^\d{1,2}$', s): + return datetime.strptime(s, "%M").time() + else: + return datetime.strptime(s, "%H:%M").time() except ValueError: return None |