summaryrefslogtreecommitdiff
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:34:14 +0100
commit13d76e69cc43cae0570cc5fab1ee02fdec33aa17 (patch)
treed3712806152aec2ba770893723db44eb544754af
parent6994297bbc571cab6181631faeb6ec7271796672 (diff)
downloadvyos-1x-13d76e69cc43cae0570cc5fab1ee02fdec33aa17.tar.gz
vyos-1x-13d76e69cc43cae0570cc5fab1ee02fdec33aa17.zip
options: T1919: beautify with open() for reboot on panic
-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: