summaryrefslogtreecommitdiff
path: root/src/op_mode/powerctrl.py
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:45:57 +0100
commita68d72122c3cc032b5a7b05dafc0578e64244c4f (patch)
tree2a013ba5361f29a5ff0112c1ca65078e934a605e /src/op_mode/powerctrl.py
parentbe09f1ec2bbc2ba23c718b01a5f3b52dde44695f (diff)
downloadvyos-1x-a68d72122c3cc032b5a7b05dafc0578e64244c4f.tar.gz
vyos-1x-a68d72122c3cc032b5a7b05dafc0578e64244c4f.zip
T1855, T1826: Restore support for reboot/poweroff in M minutes.
Diffstat (limited to 'src/op_mode/powerctrl.py')
-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