summaryrefslogtreecommitdiffstats
path: root/src/sbin
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2011-06-21 11:27:19 -0500
committerSol Jerome <sol.jerome@gmail.com>2011-06-21 11:27:19 -0500
commit45f7e202f6b7860214d709d0d470f2c8938c2993 (patch)
tree2f056a9203818c7c09084cf01dd134f07f432505 /src/sbin
parent55bb1f8cb2aca78914e896fd2a4fdf59f53882e1 (diff)
downloadbcfg2-45f7e202f6b7860214d709d0d470f2c8938c2993.tar.gz
bcfg2-45f7e202f6b7860214d709d0d470f2c8938c2993.tar.bz2
bcfg2-45f7e202f6b7860214d709d0d470f2c8938c2993.zip
bcfg2: Catch tracebacks (Tickets #1016 and #1017)
This also moves the exception handling added in #1012 to the bcfg2 code for consistency (as per Holger Weiß's suggestion). Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src/sbin')
-rwxr-xr-xsrc/sbin/bcfg28
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sbin/bcfg2 b/src/sbin/bcfg2
index 534ab8238..5ddfd8791 100755
--- a/src/sbin/bcfg2
+++ b/src/sbin/bcfg2
@@ -7,6 +7,7 @@ import fcntl
import logging
import os
import signal
+import socket
import stat
import sys
import tempfile
@@ -199,6 +200,13 @@ class Client:
self.logger.error("Failed to download probes from bcfg2")
self.logger.error(flt.faultString)
raise SystemExit(1)
+ except (Bcfg2.Proxy.CertificateError,
+ socket.gaierror,
+ socket.error):
+ e = sys.exc_info()[1]
+ self.logger.error("Failed to download probes from bcfg2: %s"
+ % e)
+ raise SystemExit(1)
times['probe_download'] = time.time()