summaryrefslogtreecommitdiff
path: root/python/walmgr.py
diff options
context:
space:
mode:
authorMartin Pihlak2011-04-01 12:22:07 +0000
committerMartin Pihlak2011-04-01 12:22:35 +0000
commitab2181dc9b93078be17d82877d69f0bf8cc0598f (patch)
treefc9741e7903a4f00f38590b00f01346d9d6c8052 /python/walmgr.py
parentf11e9e6bf7d4d011c8294c3e3394e98bf6a4a443 (diff)
ignore missing authorized_keys file on wal slave cleanup.
Diffstat (limited to 'python/walmgr.py')
-rwxr-xr-xpython/walmgr.py7
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: