From 33bae47a63cd0b174b5c6152ca6efccd03057b5e Mon Sep 17 00:00:00 2001 From: Mike McCallister Date: Sat, 15 Oct 2011 00:47:41 -0500 Subject: 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. --- src/lib/Server/Plugins/Bundler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3-1-g7c22