summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/appendix/guides/import-existing-ssh-keys.txt2
-rw-r--r--src/lib/Server/Plugins/SSHbase.py10
2 files changed, 8 insertions, 4 deletions
diff --git a/doc/appendix/guides/import-existing-ssh-keys.txt b/doc/appendix/guides/import-existing-ssh-keys.txt
index d3befec26..e606ba908 100644
--- a/doc/appendix/guides/import-existing-ssh-keys.txt
+++ b/doc/appendix/guides/import-existing-ssh-keys.txt
@@ -88,7 +88,7 @@ stats and insert it as host-specific copies of these files in
for key in ssh_host_rsa_key ssh_host_dsa_key ssh_host_key; do
sudo bcfg2-admin pull <clientname> Path /etc/ssh/$key
- sudo bcfg2-admin pull <clientname> Path /etc/ssh/${key}.pub
+ sudo bcfg2-admin pull <clientname> Path /etc/ssh/$key.pub
done
This for loop pulls data that was collected by the bcfg2 client out of
diff --git a/src/lib/Server/Plugins/SSHbase.py b/src/lib/Server/Plugins/SSHbase.py
index 6d68ecb0a..96a444875 100644
--- a/src/lib/Server/Plugins/SSHbase.py
+++ b/src/lib/Server/Plugins/SSHbase.py
@@ -274,6 +274,10 @@ class SSHbase(Bcfg2.Server.Plugin.Plugin,
# specific will always be host specific
filename = "%s/%s.H_%s" % (self.data, entry['name'].split('/')[-1],
specific.hostname)
- open(filename, 'w').write(entry['text'])
- if log:
- print "Wrote file %s" % filename
+ try:
+ open(filename, 'w').write(entry['text'])
+ if log:
+ print "Wrote file %s" % filename
+ except KeyError:
+ self.logger.error("Failed to pull %s. This file does not currently "
+ "exist on the client" % entry.get('name'))