From 64163806044bed98fcb68b46340e767deb0c8acc Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 13 Oct 2019 18:07:23 +0200 Subject: ssh.py: check if file exists before deleting it --- src/conf_mode/ssh.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/conf_mode/ssh.py') diff --git a/src/conf_mode/ssh.py b/src/conf_mode/ssh.py index 2a5cba99a..e3b11b537 100755 --- a/src/conf_mode/ssh.py +++ b/src/conf_mode/ssh.py @@ -267,7 +267,8 @@ def apply(ssh): else: # SSH access is removed in the commit os.system("sudo systemctl stop ssh.service") - os.unlink(config_file) + if os.path.isfile(config_file): + os.unlink(config_file) return None -- cgit v1.2.3