diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-10-13 18:07:23 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-10-13 18:08:22 +0200 |
commit | 64163806044bed98fcb68b46340e767deb0c8acc (patch) | |
tree | ab75eb23ebcfbb0eb15990e04a5f13aaabdd8ea8 /src | |
parent | fe7279454c86a2947b23fb0d769483b7fe2a3cc3 (diff) | |
download | vyos-1x-64163806044bed98fcb68b46340e767deb0c8acc.tar.gz vyos-1x-64163806044bed98fcb68b46340e767deb0c8acc.zip |
ssh.py: check if file exists before deleting it
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/ssh.py | 3 |
1 files changed, 2 insertions, 1 deletions
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 |