diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2011-10-05 14:16:08 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2011-10-05 14:16:08 -0400 |
commit | e8821c043cdee6ab61b811fcc508fb83f85ce71b (patch) | |
tree | 692855e630d9a3a484e0c8624a3388c0afa5e5e1 | |
parent | 4ab7706aca76118de9b3c1cabdc395b82b1acf58 (diff) | |
download | bcfg2-e8821c043cdee6ab61b811fcc508fb83f85ce71b.tar.gz bcfg2-e8821c043cdee6ab61b811fcc508fb83f85ce71b.tar.bz2 bcfg2-e8821c043cdee6ab61b811fcc508fb83f85ce71b.zip |
fixed issue with bogus filenames in Bundler in a more generic way for all DirectoryBacked plugins
-rw-r--r-- | src/lib/Server/Plugin.py | 5 | ||||
-rw-r--r-- | src/lib/Server/Plugins/Bundler.py | 9 |
2 files changed, 4 insertions, 10 deletions
diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py index 414713793..a621944a6 100644 --- a/src/lib/Server/Plugin.py +++ b/src/lib/Server/Plugin.py @@ -518,11 +518,10 @@ class DirectoryBacked(object): if ((event.filename[-1] == '~') or (event.filename[:2] == '.#') or (event.filename[-4:] == '.swp') or - (event.filename in ['SCCS', '.svn', '4913'])): + (event.filename in ['SCCS', '.svn', '4913']) or + (not self.patterns.match(event.filename))): return if action in ['exists', 'created']: - if not self.patterns.match(event.filename): - return self.add_entry(relpath, event) elif action == 'changed': if relpath in self.entries: diff --git a/src/lib/Server/Plugins/Bundler.py b/src/lib/Server/Plugins/Bundler.py index ec73d5022..bf0c42416 100644 --- a/src/lib/Server/Plugins/Bundler.py +++ b/src/lib/Server/Plugins/Bundler.py @@ -52,13 +52,8 @@ class Bundler(Bcfg2.Server.Plugin.Plugin, raise Bcfg2.Server.Plugin.PluginInitError def template_dispatch(self, name): - if name.endswith('.xml') or name.endswith('.genshi'): - bundle = lxml.etree.parse(name) - nsmap = bundle.getroot().nsmap - else: - self.logger.warning("Skipping unknown file %s" % name) - return - + bundle = lxml.etree.parse(name) + nsmap = bundle.getroot().nsmap if name.endswith('.xml'): if have_genshi and \ (nsmap == {'py': 'http://genshi.edgewall.org/'}): |