From a68d72122c3cc032b5a7b05dafc0578e64244c4f Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 9 Dec 2019 23:45:57 +0100 Subject: T1855, T1826: Restore support for reboot/poweroff in M minutes. --- src/op_mode/powerctrl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3