summaryrefslogtreecommitdiffstats
path: root/src/sbin
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-11-23 14:18:31 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-11-23 14:18:31 +0000
commit820b2a677475e26aa29a23cd9c4eadcaf4ec4730 (patch)
treed4967f03a48386d5700329f6eb1fa0e37b7a6d43 /src/sbin
parentc44c69fc0d288c4674ddef02d25b10ecb461385b (diff)
downloadbcfg2-820b2a677475e26aa29a23cd9c4eadcaf4ec4730.tar.gz
bcfg2-820b2a677475e26aa29a23cd9c4eadcaf4ec4730.tar.bz2
bcfg2-820b2a677475e26aa29a23cd9c4eadcaf4ec4730.zip
Fixup server error handling
* Remove ssl key print * Handle bind failure case cleanly git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2533 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin')
-rwxr-xr-xsrc/sbin/bcfg2-server11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server
index c6d3d9ab7..4204b49ba 100755
--- a/src/sbin/bcfg2-server
+++ b/src/sbin/bcfg2-server
@@ -59,6 +59,10 @@ def critical_error(operation):
logger.error(operation, exc_info=1)
raise Fault, (7, "Critical unexpected failure: %s" % (operation))
+class SetupError(Exception):
+ '''Used when the server cant be setup'''
+ pass
+
class Bcfg2Serv(Bcfg2.Server.Component.Component):
"""The Bcfg2 Server component providing XML-RPC access to Bcfg methods"""
__name__ = 'bcfg2'
@@ -71,8 +75,7 @@ class Bcfg2Serv(Bcfg2.Server.Component.Component):
Bcfg2.Server.Component.Component.__init__(self, setup)
self.shut = False
except Bcfg2.Server.Component.ComponentInitError:
- logger.critical("Failed to setup server")
- raise SystemExit, 1
+ raise SetupError
# set shutdown handlers for sigint and sigterm
signal.signal(signal.SIGINT, self.start_shutdown)
@@ -216,8 +219,8 @@ if __name__ == '__main__':
daemonize(SSETUP['daemon'])
try:
BSERV = Bcfg2Serv(SSETUP)
- except:
- critical_error("Failed to setup server; probably a key problem")
+ except SetupError:
+ raise SystemExit, 1
while not BSERV.shut:
try:
BSERV.serve_forever()