diff options
author | Rick Bradshow <bradshaw@mcs.anl.gov> | 2006-10-24 17:49:47 +0000 |
---|---|---|
committer | Rick Bradshow <bradshaw@mcs.anl.gov> | 2006-10-24 17:49:47 +0000 |
commit | b2eaa020171e5d75422ecbce531684ea1f6f1134 (patch) | |
tree | 7c70e7b4f9933d8a3e6a79b806fb5c033dc0ab95 /src/lib/Server/Plugins/Cfg.py | |
parent | 503526f4dd21dddc019c9731821ced44506b12c9 (diff) | |
download | bcfg2-b2eaa020171e5d75422ecbce531684ea1f6f1134.tar.gz bcfg2-b2eaa020171e5d75422ecbce531684ea1f6f1134.tar.bz2 bcfg2-b2eaa020171e5d75422ecbce531684ea1f6f1134.zip |
updated the probe code to not include probes with no content.
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2453 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugins/Cfg.py')
-rw-r--r-- | src/lib/Server/Plugins/Cfg.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/lib/Server/Plugins/Cfg.py b/src/lib/Server/Plugins/Cfg.py index 14e49fc27..850ce016b 100644 --- a/src/lib/Server/Plugins/Cfg.py +++ b/src/lib/Server/Plugins/Cfg.py @@ -260,14 +260,17 @@ class Cfg(Bcfg2.Server.Plugin.Plugin): if self.interpolate: 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) + if entry.data: + 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')) + else: + probe.set('interpreter', '/bin/sh') + ret.append(probe) probe = lxml.etree.Element('probe') probe.set('name', 'hostname') probe.set('source', 'Cfg') |