summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaul Cuza <raulcuza@gmail.com>2011-01-31 12:26:43 -0500
committerRaul Cuza <raulcuza@gmail.com>2011-01-31 12:26:43 -0500
commitfb1c1bf2fc5752317286b2d79e93fd03632f592e (patch)
treee4ffd3e1f3dc326b2ed57fe1df38d5828d9b2b15
parente2e3f50705bd550285f78f40215ef3d80ba2c945 (diff)
parent943322205d4576e5ff5d1ee01373762aa5b7c1af (diff)
downloadbcfg2-fb1c1bf2fc5752317286b2d79e93fd03632f592e.tar.gz
bcfg2-fb1c1bf2fc5752317286b2d79e93fd03632f592e.tar.bz2
bcfg2-fb1c1bf2fc5752317286b2d79e93fd03632f592e.zip
Merge remote branch 'upstream/master'
-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'))