diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2009-01-21 17:01:42 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2009-01-21 17:01:42 +0000 |
commit | 0ca22dfbc22d89d33f37ff1661f24e6ea6654499 (patch) | |
tree | c186f68c11c83ac2b5cec5d8ef51d33adb7beb11 /src/lib/Server/Plugins | |
parent | 90fcec89650af7183027a19347653d9768add2cd (diff) | |
download | bcfg2-0ca22dfbc22d89d33f37ff1661f24e6ea6654499.tar.gz bcfg2-0ca22dfbc22d89d33f37ff1661f24e6ea6654499.tar.bz2 bcfg2-0ca22dfbc22d89d33f37ff1661f24e6ea6654499.zip |
Remove old properties implementation and hardwiring
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5036 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugins')
-rw-r--r-- | src/lib/Server/Plugins/Cfg.py | 6 | ||||
-rw-r--r-- | src/lib/Server/Plugins/Probes.py | 2 | ||||
-rw-r--r-- | src/lib/Server/Plugins/SGenshi.py | 11 | ||||
-rw-r--r-- | src/lib/Server/Plugins/TCheetah.py | 10 | ||||
-rw-r--r-- | src/lib/Server/Plugins/TGenshi.py | 8 |
5 files changed, 12 insertions, 25 deletions
diff --git a/src/lib/Server/Plugins/Cfg.py b/src/lib/Server/Plugins/Cfg.py index 85ace20bc..f9a2f737d 100644 --- a/src/lib/Server/Plugins/Cfg.py +++ b/src/lib/Server/Plugins/Cfg.py @@ -49,8 +49,9 @@ class CfgMatcher: return self.basefile_reg.match(fname) class CfgEntrySet(Bcfg2.Server.Plugin.EntrySet): - def __init__(self, basename, path, props, entry_type, encoding): - Bcfg2.Server.Plugin.EntrySet.__init__(self, basename, path, props, entry_type, encoding) + def __init__(self, basename, path, entry_type, encoding): + Bcfg2.Server.Plugin.EntrySet.__init__(self, basename, path, entry_type, + encoding) self.specific = CfgMatcher(path.split('/')[-1]) def sort_by_specific(self, one, other): @@ -131,7 +132,6 @@ class Cfg(Bcfg2.Server.Plugin.GroupSpool, name = 'Cfg' __version__ = '$Id$' __author__ = 'bcfg-dev@mcs.anl.gov' - use_props = False es_cls = CfgEntrySet es_child_cls = Bcfg2.Server.Plugin.SpecificData diff --git a/src/lib/Server/Plugins/Probes.py b/src/lib/Server/Plugins/Probes.py index 6c7590da0..10b729fde 100644 --- a/src/lib/Server/Plugins/Probes.py +++ b/src/lib/Server/Plugins/Probes.py @@ -8,7 +8,7 @@ class ProbeSet(Bcfg2.Server.Plugin.EntrySet): def __init__(self, path, fam, encoding, plugin_name): fpattern = '[0-9A-Za-z_\-]+' self.plugin_name = plugin_name - Bcfg2.Server.Plugin.EntrySet.__init__(self, fpattern, path, True, + Bcfg2.Server.Plugin.EntrySet.__init__(self, fpattern, path, Bcfg2.Server.Plugin.SpecificData, encoding) fam.AddMonitor(path, self) diff --git a/src/lib/Server/Plugins/SGenshi.py b/src/lib/Server/Plugins/SGenshi.py index e7e0b94b8..93dc15e7b 100644 --- a/src/lib/Server/Plugins/SGenshi.py +++ b/src/lib/Server/Plugins/SGenshi.py @@ -9,8 +9,7 @@ logger = logging.getLogger('Bcfg2.Plugins.SGenshi') class SGenshiTemplateFile(Bcfg2.Server.Plugins.TGenshi.TemplateFile): def get_xml_value(self, metadata): - stream = self.template.generate(metadata=metadata, - properties=self.properties.properties).filter( \ + stream = self.template.generate(metadata=metadata,).filter( \ Bcfg2.Server.Plugins.TGenshi.removecomment) data = stream.render('xml') return lxml.etree.XML(data) @@ -18,13 +17,7 @@ class SGenshiTemplateFile(Bcfg2.Server.Plugins.TGenshi.TemplateFile): class SGenshiEntrySet(Bcfg2.Server.Plugin.EntrySet): def __init__(self, path, fam, encoding): fpattern = '\S+\.xml' - try: - properties = Bcfg2.Server.Plugin.TemplateProperties( \ - '%s/../etc/properties.xml' % (path), fam) - except: - properties = Bcfg2.Server.Plugin.FakeProperties() - - Bcfg2.Server.Plugin.EntrySet.__init__(self, fpattern, path, properties, + Bcfg2.Server.Plugin.EntrySet.__init__(self, fpattern, path, SGenshiTemplateFile, encoding) fam.AddMonitor(path, self) diff --git a/src/lib/Server/Plugins/TCheetah.py b/src/lib/Server/Plugins/TCheetah.py index c2e632351..9806e5787 100644 --- a/src/lib/Server/Plugins/TCheetah.py +++ b/src/lib/Server/Plugins/TCheetah.py @@ -9,13 +9,11 @@ logger = logging.getLogger('Bcfg2.Plugins.TCheetah') class TemplateFile: '''Template file creates Cheetah template structures for the loaded file''' - def __init__(self, name, properties, specific, encoding): + def __init__(self, name, specific, encoding): self.name = name - self.properties = properties self.specific = specific self.encoding = encoding self.template = None - self.searchlist = {'properties': properties} def handle_event(self, event): '''Handle all fs events for this template''' @@ -24,9 +22,7 @@ class TemplateFile: try: s = {'useStackFrames': False} self.template = Cheetah.Template.Template(open(self.name).read(), - compilerSettings=s, - searchList = [self.searchlist]) - self.template.properties = self.properties.properties + compilerSettings=s) except Cheetah.Parser.ParseError, perror: logger.error("Cheetah parse error for file %s" % (self.name)) logger.error(perror.report()) @@ -62,4 +58,4 @@ class TCheetah(Bcfg2.Server.Plugin.GroupSpool): __author__ = 'bcfg-dev@mcs.anl.gov' filename_pattern = 'template' es_child_cls = TemplateFile - use_props = True + diff --git a/src/lib/Server/Plugins/TGenshi.py b/src/lib/Server/Plugins/TGenshi.py index 1dfe2f3c5..40e65b877 100644 --- a/src/lib/Server/Plugins/TGenshi.py +++ b/src/lib/Server/Plugins/TGenshi.py @@ -23,9 +23,8 @@ def removecomment(stream): class TemplateFile: '''Template file creates Genshi template structures for the loaded file''' - def __init__(self, name, properties, specific, encoding): + def __init__(self, name, specific, encoding): self.name = name - self.properties = properties self.specific = specific self.encoding = encoding if self.specific.all: @@ -62,8 +61,8 @@ class TemplateFile: fname = entry.get('realname', entry.get('name')) try: stream = self.template.generate( \ - name=fname, metadata=metadata, path=self.name, - properties=self.properties).filter(removecomment) + name=fname, metadata=metadata, + path=self.name).filter(removecomment) if have_ntt: ttypes = [TextTemplate, NewTextTemplate] else: @@ -99,6 +98,5 @@ class TGenshi(Bcfg2.Server.Plugin.GroupSpool): name = 'TGenshi' __version__ = '$Id$' __author__ = 'jeff@ocjtech.us' - use_props = True filename_pattern = 'template\.(txt|newtxt|xml)' es_child_cls = TemplateFile |