diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-12-30 15:45:41 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-12-30 15:45:41 +0100 |
commit | 9436b433df3f10260a4802b51f6259424fb986dc (patch) | |
tree | 650d7abf619ba97ca0b3778d38e93869880488ce /src/conf_mode | |
parent | 9b1cfeff18a23dfbefd485741ac4609c92707dfd (diff) | |
download | vyos-1x-9436b433df3f10260a4802b51f6259424fb986dc.tar.gz vyos-1x-9436b433df3f10260a4802b51f6259424fb986dc.zip |
options: T1919: check file existance before os.unlink()
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/system-options.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/conf_mode/system-options.py b/src/conf_mode/system-options.py index 74c34e19f..a893e98b3 100755 --- a/src/conf_mode/system-options.py +++ b/src/conf_mode/system-options.py @@ -57,7 +57,8 @@ def apply(opt): # Ctrl-Alt-Delete action if opt['ctrl_alt_del'] == 'ignore': - os.unlink('/lib/systemd/system/ctrl-alt-del.target') + if os.path.exists(systemd_ctrl_alt_del): + os.unlink('/lib/systemd/system/ctrl-alt-del.target') elif opt['ctrl_alt_del'] == 'reboot': if os.path.exists(systemd_ctrl_alt_del): |