diff options
Diffstat (limited to 'python')
-rwxr-xr-x | python/walmgr.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/python/walmgr.py b/python/walmgr.py index a7ea189c..8e189229 100755 --- a/python/walmgr.py +++ b/python/walmgr.py @@ -635,10 +635,11 @@ class WalMgr(skytools.DBScript): if not self.not_really: shutil.rmtree(dirname) - if self.options.ssh_remove_key: + ssh_dir = os.path.expanduser("~/.ssh") + auth_file = os.path.join(ssh_dir, "authorized_keys") + + if self.options.ssh_remove_key and os.path.isfile(auth_file): # remove master key from ssh authorized keys, simple substring match should do - ssh_dir = os.path.expanduser("~/.ssh") - auth_file = os.path.join(ssh_dir, "authorized_keys") keys = "" for key in open(auth_file): if not self.options.ssh_remove_key in key: |