summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2005-09-23 16:49:00 +0000
committerNarayan Desai <desai@mcs.anl.gov>2005-09-23 16:49:00 +0000
commitaa2a5259cebfc629bf1394a9e1a9079c210ce590 (patch)
tree580ebfbc8dbe11aa87f0e8fb343ea7f04e87f765 /src
parentca2118c81356b9b39845cd36cb9b61b0af1e03b9 (diff)
downloadbcfg2-aa2a5259cebfc629bf1394a9e1a9079c210ce590.tar.gz
bcfg2-aa2a5259cebfc629bf1394a9e1a9079c210ce590.tar.bz2
bcfg2-aa2a5259cebfc629bf1394a9e1a9079c210ce590.zip
fix error path when plugin data doesn't exist
(Logical change 1.318) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1298 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Plugins/Svcmgr.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/Server/Plugins/Svcmgr.py b/src/lib/Server/Plugins/Svcmgr.py
index a1b6442ff..2f2c7e5eb 100644
--- a/src/lib/Server/Plugins/Svcmgr.py
+++ b/src/lib/Server/Plugins/Svcmgr.py
@@ -1,7 +1,7 @@
'''This generator provides service mappings'''
__revision__ = '$Revision$'
-from Bcfg2.Server.Plugin import Plugin, ScopedXMLFile
+from Bcfg2.Server.Plugin import Plugin, ScopedXMLFile, PluginInitError
class Svcmgr(Plugin):
'''This is a generator that handles service assignments'''
@@ -11,7 +11,11 @@ class Svcmgr(Plugin):
def __init__(self, core, datastore):
Plugin.__init__(self, core, datastore)
- self.svc = ScopedXMLFile("%s/etc/services.xml"%(datastore), self.core.fam)
+ try:
+ self.svc = ScopedXMLFile("%s/etc/services.xml"%(datastore), self.core.fam)
+ except OSError:
+ self.LogError("Failed to load service definition file")
+ raise PluginInitError
self.Entries = self.svc.__provides__