summaryrefslogtreecommitdiffstats
path: root/src/lib/Server
diff options
context:
space:
mode:
authorRick Bradshow <bradshaw@mcs.anl.gov>2006-08-22 21:13:33 +0000
committerRick Bradshow <bradshaw@mcs.anl.gov>2006-08-22 21:13:33 +0000
commit162663a7614ad275f6701042d6e2093a2d69869f (patch)
tree5500bda4e303d0dd1bbb175588760ae0ccd15bce /src/lib/Server
parent4a9d1bac1d78239768a740a7dcc5ae83f8f3d114 (diff)
downloadbcfg2-162663a7614ad275f6701042d6e2093a2d69869f.tar.gz
bcfg2-162663a7614ad275f6701042d6e2093a2d69869f.tar.bz2
bcfg2-162663a7614ad275f6701042d6e2093a2d69869f.zip
fix for a nonexistent /Probes dir.
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2090 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server')
-rw-r--r--src/lib/Server/Plugins/Cfg.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/lib/Server/Plugins/Cfg.py b/src/lib/Server/Plugins/Cfg.py
index b19fe8c6a..e00c0a380 100644
--- a/src/lib/Server/Plugins/Cfg.py
+++ b/src/lib/Server/Plugins/Cfg.py
@@ -237,7 +237,10 @@ class Cfg(Bcfg2.Server.Plugin.Plugin):
self.directories = []
self.AddDirectoryMonitor(self.data)
self.interpolate = False #this is true if any file in the repo needs to be interpolated.
- self.probes = Bcfg2.Server.Plugin.DirectoryBacked(datastore + '/Probes', self.core.fam )
+ try:
+ self.probes = Bcfg2.Server.Plugin.DirectoryBacked(datastore + '/Probes', self.core.fam )
+ except:
+ self.probes = False
# eventually flush fam events here so that all entries built here
# ready to go
@@ -246,15 +249,16 @@ class Cfg(Bcfg2.Server.Plugin.Plugin):
ret = []
bangline = re.compile('^#!(?P<interpreter>(/\w+)+)$')
if self.interpolate:
- for name, entry in self.probes.entries.iteritems():
- probe = lxml.etree.Element('probe')
- probe.set('name', name )
- probe.set('source', 'Cfg')
- probe.text = entry.data
- match = bangline.match(entry.data.split('\n')[0])
- if match:
- probe.set('interpreter', match.group('interpreter'))
- ret.append(probe)
+ if self.probes:
+ for name, entry in self.probes.entries.iteritems():
+ probe = lxml.etree.Element('probe')
+ probe.set('name', name )
+ probe.set('source', 'Cfg')
+ probe.text = entry.data
+ match = bangline.match(entry.data.split('\n')[0])
+ if match:
+ probe.set('interpreter', match.group('interpreter'))
+ ret.append(probe)
probe = lxml.etree.Element('probe')
probe.set('name', 'hostname')
probe.set('source', 'Cfg')