summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2005-06-22 22:03:49 +0000
committerNarayan Desai <desai@mcs.anl.gov>2005-06-22 22:03:49 +0000
commita878235420f520259055619e0a35f397576a321e (patch)
tree859aa40426d71ca43591296df49c8c60923c6944
parentea52c719b37c098e2f2d3b6cea49c9b9cc55a9f7 (diff)
downloadbcfg2-a878235420f520259055619e0a35f397576a321e.tar.gz
bcfg2-a878235420f520259055619e0a35f397576a321e.tar.bz2
bcfg2-a878235420f520259055619e0a35f397576a321e.zip
fix error message
2005/06/22 17:02:52-05:00 anl.gov!desai fix double def 2005/06/22 17:01:33-05:00 anl.gov!desai add CoreInitError (Logical change 1.237) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@991 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r--src/lib/Server/Core.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/Server/Core.py b/src/lib/Server/Core.py
index be3bc7732..9c1161c7b 100644
--- a/src/lib/Server/Core.py
+++ b/src/lib/Server/Core.py
@@ -19,6 +19,10 @@ class PublishError(Exception):
'''This error is raised upon publication failures'''
pass
+class CoreInitError(Exception):
+ '''This error is raised when the core cannot be initialized'''
+ pass
+
class Fam(object):
'''The fam object is a set of callbacks for file alteration events'''
@@ -67,9 +71,6 @@ class PublishedValue(object):
raise PublishError, (self.key, owner)
self.value = value
-class CoreInitError(Exception):
- pass
-
class Core(object):
'''The Core object is the container for all Bcfg2 Server logic, and modules'''
def __init__(self, setup, configfile):
@@ -77,7 +78,10 @@ class Core(object):
cfile = ConfigParser()
cfile.read([configfile])
self.datastore = cfile.get('server','repository')
- self.fam = Fam()
+ try:
+ self.fam = Fam()
+ except IOError:
+ raise CoreInitError, "failed to connect to fam"
self.pubspace = {}
self.structures = []
self.generators = []