summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-03-29 20:34:56 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-03-29 20:34:56 +0000
commit0c2400d60b5eb9b5b6a0b161224ed7a84b925049 (patch)
tree43c3a103f660cce57f65700758c593c7e4f57dce
parent53d678d24a60c6100bfcd95f49b2e40bf1093ca4 (diff)
downloadbcfg2-0c2400d60b5eb9b5b6a0b161224ed7a84b925049.tar.gz
bcfg2-0c2400d60b5eb9b5b6a0b161224ed7a84b925049.tar.bz2
bcfg2-0c2400d60b5eb9b5b6a0b161224ed7a84b925049.zip
* Remove build dep on python-dev
* Improve error handing when no ssl key is available git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1817 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r--debian/control2
-rw-r--r--src/lib/Server/Component.py10
-rwxr-xr-xsrc/sbin/bcfg2-server6
3 files changed, 15 insertions, 3 deletions
diff --git a/debian/control b/debian/control
index 723334d7c..b0fa87cb7 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: bcfg2
Section: admin
Priority: optional
Maintainer: Narayan Desai <desai@mcs.anl.gov>
-Build-Depends: debhelper (>= 4.0.0), python-dev
+Build-Depends: debhelper (>= 4.0.0)
Standards-Version: 3.6.1.1
Package: bcfg2
diff --git a/src/lib/Server/Component.py b/src/lib/Server/Component.py
index 3d1ffd1e7..73f28446e 100644
--- a/src/lib/Server/Component.py
+++ b/src/lib/Server/Component.py
@@ -8,6 +8,10 @@ import Bcfg2.Client.Proxy as Proxy
log = logging.getLogger('Component')
+class ComponentInitError(Exception):
+ '''Raised in case of component initialization failure'''
+ pass
+
class CobaltXMLRPCRequestHandler(SimpleXMLRPCServer.SimpleXMLRPCRequestHandler):
'''CobaltXMLRPCRequestHandler takes care of ssl xmlrpc requests'''
def finish(self):
@@ -96,7 +100,11 @@ class Component(SSLServer,
self.password = self.cfile.get('communication', 'password')
- SSLServer.__init__(self, location, keyfile, CobaltXMLRPCRequestHandler)
+ try:
+ SSLServer.__init__(self, location, keyfile, CobaltXMLRPCRequestHandler)
+ except:
+ self.logger.error("Failed to load ssl key %s" % (keyfile))
+ raise ComponentInitError
SimpleXMLRPCServer.SimpleXMLRPCDispatcher.__init__(self)
self.logRequests = 0
self.port = self.socket.getsockname()[1]
diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server
index 8e698e5ac..2b0d71d55 100755
--- a/src/sbin/bcfg2-server
+++ b/src/sbin/bcfg2-server
@@ -83,7 +83,11 @@ class Bcfg2Serv(Bcfg2.Server.Component.Component):
request_queue_size = 15
def __init__(self, setup):
- Bcfg2.Server.Component.Component.__init__(self, setup)
+ try:
+ Bcfg2.Server.Component.Component.__init__(self, setup)
+ except Bcfg2.Server.Component.ComponentInitError:
+ self.shut = True
+ return
self.shut = False
# set shutdown handlers for sigint and sigterm
signal.signal(signal.SIGINT, self.start_shutdown)