diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-01-18 18:34:14 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-01-18 18:34:14 +0100 |
commit | 13d76e69cc43cae0570cc5fab1ee02fdec33aa17 (patch) | |
tree | d3712806152aec2ba770893723db44eb544754af | |
parent | 6994297bbc571cab6181631faeb6ec7271796672 (diff) | |
download | vyos-1x-13d76e69cc43cae0570cc5fab1ee02fdec33aa17.tar.gz vyos-1x-13d76e69cc43cae0570cc5fab1ee02fdec33aa17.zip |
options: T1919: beautify with open() for reboot on panic
-rwxr-xr-x | src/conf_mode/system-option.py | 8 |
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: |