summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2005-02-01 22:09:42 +0000
committerNarayan Desai <desai@mcs.anl.gov>2005-02-01 22:09:42 +0000
commit377e23a6dcf3940069307fdbb93ce159ade34c77 (patch)
treef9f5fe50337c4d3058fd86695e7524e7fe630bc8 /src/lib
parentecb622346abd562e677a20e4e40180ead4984a59 (diff)
downloadbcfg2-377e23a6dcf3940069307fdbb93ce159ade34c77.tar.gz
bcfg2-377e23a6dcf3940069307fdbb93ce159ade34c77.tar.bz2
bcfg2-377e23a6dcf3940069307fdbb93ce159ade34c77.zip
add CoreInitError and add error handling for the "no metadata" case
2005/02/01 11:29:28-06:00 anl.gov!desai loose default setting for cfile (Logical change 1.200) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@853 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Core.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/Server/Core.py b/src/lib/Server/Core.py
index b250fa0dd..be3bc7732 100644
--- a/src/lib/Server/Core.py
+++ b/src/lib/Server/Core.py
@@ -67,9 +67,12 @@ 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='/etc/bcfg2.conf'):
+ def __init__(self, setup, configfile):
object.__init__(self)
cfile = ConfigParser()
cfile.read([configfile])
@@ -82,7 +85,11 @@ class Core(object):
self.setup = setup
mpath = cfile.get('server','metadata')
- self.metadata = MetadataStore("%s/metadata.xml" % mpath, self.fam)
+ try:
+ self.metadata = MetadataStore("%s/metadata.xml" % mpath, self.fam)
+ except OSError:
+ raise CoreInitError, "metadata path incorrect"
+
self.stats = Statistics("%s/statistics.xml" % (mpath))
for structure in cfile.get('server', 'structures').split(','):