diff options
author | Mike McCallister <mike@mccllstr.com> | 2011-10-15 00:47:41 -0500 |
---|---|---|
committer | Mike McCallister <mike@mccllstr.com> | 2011-10-15 00:47:41 -0500 |
commit | 33bae47a63cd0b174b5c6152ca6efccd03057b5e (patch) | |
tree | 25a8ce6c098476266a0c84f0552cf2493b222881 /src/lib/Server/Plugins/Bundler.py | |
parent | db05bc553a28334795dc2990cacb03717798aebd (diff) | |
download | bcfg2-33bae47a63cd0b174b5c6152ca6efccd03057b5e.tar.gz bcfg2-33bae47a63cd0b174b5c6152ca6efccd03057b5e.tar.bz2 bcfg2-33bae47a63cd0b174b5c6152ca6efccd03057b5e.zip |
Avoid reporting Genshi bundles as missing
Genshi bundles were reported as missing in the configuration with
error messages like the following:
Client CLIENTNAME configuration missing bundles: GBUNDLE1:GBUNDLE2
This seems to be caused by the Bundle name being derived from the
filename, which was assumed to end in a four character extension of
".xml". When the extension was actually ".genshi", the ".ge" portion
was left behind, and the code couldn't match up the requested bundles
with the generated bundles.
Diffstat (limited to 'src/lib/Server/Plugins/Bundler.py')
-rw-r--r-- | src/lib/Server/Plugins/Bundler.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/Server/Plugins/Bundler.py b/src/lib/Server/Plugins/Bundler.py index bf0c42416..4b73a17d4 100644 --- a/src/lib/Server/Plugins/Bundler.py +++ b/src/lib/Server/Plugins/Bundler.py @@ -4,6 +4,7 @@ __revision__ = '$Revision$' import copy import lxml.etree import os +import os.path import re import sys @@ -21,7 +22,7 @@ except: class BundleFile(Bcfg2.Server.Plugin.StructFile): def get_xml_value(self, metadata): - bundlename = self.name.split('/')[-1][:-4] + bundlename = os.path.splitext(os.path.basename(self.name))[0] bundle = lxml.etree.Element('Bundle', name=bundlename) [bundle.append(copy.deepcopy(item)) for item in self.Match(metadata)] return bundle |