From ecb622346abd562e677a20e4e40180ead4984a59 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Tue, 1 Feb 2005 22:09:42 +0000 Subject: add error handling for CoreInitError 2005/02/01 11:30:34-06:00 anl.gov!desai fix Core usage (Logical change 1.200) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@852 ce84e21b-d406-0410-9b95-82705330c041 --- src/sbin/Bcfg2Server | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/sbin/Bcfg2Server b/src/sbin/Bcfg2Server index c850e7750..b9a1af96d 100644 --- a/src/sbin/Bcfg2Server +++ b/src/sbin/Bcfg2Server @@ -13,7 +13,7 @@ from traceback import extract_tb from elementtree.ElementTree import Element -from Bcfg2.Server.Core import Core +from Bcfg2.Server.Core import Core, CoreInitError from Bcfg2.Server.Metadata import MetadataConsistencyError from Bcfg2.Server.Statistics import Statistics @@ -53,7 +53,11 @@ class BcfgServer(Server): def __setup__(self): self.setup = self.kwargs['setup'] - self.core = Core(self.kwargs.get('configfile', '/etc/bcfg2.conf')) + try: + self.core = Core(setup, self.kwargs.get('configfile', '/etc/bcfg2.conf')) + except CoreInitError, msg: + print msg + raise SystemExit, 1 self.__progress__() def __progress__(self): -- cgit v1.2.3-1-g7c22