summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-01-18 18:34:14 +0100
committerChristian Poessinger <christian@poessinger.com>2021-01-18 18:36:48 +0100
commitd59d66e732a96ac605d921ed37ddd6bfbdfaf082 (patch)
treeec7b3e75aa51652ecec1237ee25eb0f0e8ad8e12 /src
parentc71bf9ca97a04d578eb1f600fb7435b001fd17cd (diff)
downloadvyos-1x-d59d66e732a96ac605d921ed37ddd6bfbdfaf082.tar.gz
vyos-1x-d59d66e732a96ac605d921ed37ddd6bfbdfaf082.zip
options: T1919: beautify with open() for reboot on panic
(cherry picked from commit 13d76e69cc43cae0570cc5fab1ee02fdec33aa17)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/system-option.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/conf_mode/system-option.py b/src/conf_mode/system-option.py
index 910c14474..212afc125 100755
--- a/src/conf_mode/system-option.py
+++ b/src/conf_mode/system-option.py
@@ -104,11 +104,11 @@ def apply(options):
os.unlink(ssh_config)
# Reboot system on kernel panic
+ timeout = '0'
+ if 'reboot_on_panic' in options:
+ timeout = '60'
with open('/proc/sys/kernel/panic', 'w') as f:
- if 'reboot_on_panic' in options:
- f.write('60')
- else:
- f.write('0')
+ f.write(timeout)
# tuned - performance tuning
if 'performance' in options: