summaryrefslogtreecommitdiffstats
path: root/src/lib/Component.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-06-23 01:56:08 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-06-23 01:56:08 +0000
commit7139c9cd7ea4a1d13323d4add72f87a0bd3f293f (patch)
tree9f647d67e1cfe3b1011cf5e1d0e276398d04046b /src/lib/Component.py
parent940f209fae2491f42daf34b7bfb0fd052316c955 (diff)
downloadbcfg2-7139c9cd7ea4a1d13323d4add72f87a0bd3f293f.tar.gz
bcfg2-7139c9cd7ea4a1d13323d4add72f87a0bd3f293f.tar.bz2
bcfg2-7139c9cd7ea4a1d13323d4add72f87a0bd3f293f.zip
Improve server error handling
Issues - Log bind failures properly - Log ssl key/cert/ca key existence problems git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5294 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Component.py')
-rw-r--r--src/lib/Component.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/Component.py b/src/lib/Component.py
index 9449d3df7..b3f8a0941 100644
--- a/src/lib/Component.py
+++ b/src/lib/Component.py
@@ -18,6 +18,8 @@ import Bcfg2.Logger
from Bcfg2.Statistics import Statistics
from Bcfg2.SSLServer import XMLRPCServer
+logger = logging.getLogger()
+
class NoExposedMethod (Exception):
"""There is no method exposed with the given name."""
@@ -59,9 +61,12 @@ def run_component (component_cls, location, daemon, pidfile_name, argv=None,
up = urlparse.urlparse(location)
port = tuple(up[1].split(':'))
port = (port[0], int(port[1]))
-
- server = XMLRPCServer(port, keyfile=keyfile, certfile=certfile,
- register=register, timeout=time_out, ca=ca)
+ try:
+ server = XMLRPCServer(port, keyfile=keyfile, certfile=certfile,
+ register=register, timeout=time_out, ca=ca)
+ except:
+ logger.error("Server startup failed")
+ os._exit(1)
server.register_instance(component)
try: