diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2011-01-31 09:40:56 -0600 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2011-01-31 09:40:56 -0600 |
commit | 8dae884cba115d4013d3038d8b97d6e840d48d88 (patch) | |
tree | 5764cb094752f2c237dba02cfbecb640e127aee8 /src/lib/Server | |
parent | 27a4fb9b2ffcd635aa5c7cf9ce454e1a943c1a96 (diff) | |
download | bcfg2-8dae884cba115d4013d3038d8b97d6e840d48d88.tar.gz bcfg2-8dae884cba115d4013d3038d8b97d6e840d48d88.tar.bz2 bcfg2-8dae884cba115d4013d3038d8b97d6e840d48d88.zip |
SSHbase: Fix hang when file not present on client
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src/lib/Server')
-rw-r--r-- | src/lib/Server/Plugins/SSHbase.py | 10 |
1 files changed, 7 insertions, 3 deletions
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')) |