diff options
author | Martin Pihlak | 2011-04-01 12:22:07 +0000 |
---|---|---|
committer | Martin Pihlak | 2011-04-01 12:22:35 +0000 |
commit | ab2181dc9b93078be17d82877d69f0bf8cc0598f (patch) | |
tree | fc9741e7903a4f00f38590b00f01346d9d6c8052 /python/walmgr.py | |
parent | f11e9e6bf7d4d011c8294c3e3394e98bf6a4a443 (diff) |
ignore missing authorized_keys file on wal slave cleanup.
Diffstat (limited to 'python/walmgr.py')
-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: |