summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2019-12-09 23:45:57 +0100
committerDaniil Baturin <daniil@baturin.org>2019-12-09 23:46:23 +0100
commit479a345e9ae6cb132498724e2285f6674a54a3c8 (patch)
tree8ed9f3d58de41df6147c2422a593e3ef1c6ed17a /src
parent7d8d04ae2fcdb6346029b9e4be2fefb2f0d2b309 (diff)
downloadvyos-1x-479a345e9ae6cb132498724e2285f6674a54a3c8.tar.gz
vyos-1x-479a345e9ae6cb132498724e2285f6674a54a3c8.zip
T1855, T1826: Restore support for reboot/poweroff in M minutes.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/op_mode/powerctrl.py5
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