From 13d76e69cc43cae0570cc5fab1ee02fdec33aa17 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 18 Jan 2021 18:34:14 +0100 Subject: options: T1919: beautify with open() for reboot on panic --- src/conf_mode/system-option.py | 8 ++++---- 1 file 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: -- cgit v1.2.3