summaryrefslogtreecommitdiffstats
path: root/src/lib/Server
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Server')
-rw-r--r--src/lib/Server/Plugins/Bundler.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/Server/Plugins/Bundler.py b/src/lib/Server/Plugins/Bundler.py
index 04aa3df71..418e47bcb 100644
--- a/src/lib/Server/Plugins/Bundler.py
+++ b/src/lib/Server/Plugins/Bundler.py
@@ -75,9 +75,13 @@ class Bundler(Bcfg2.Server.Plugin.Plugin,
def BuildStructures(self, metadata):
"""Build all structures for client (metadata)."""
bundleset = []
+
+ bundle_entries = {}
+ for key, item in self.entries.items():
+ bundle_entries.setdefault(self.patterns.match(os.path.basename(key)).group('name'), []).append(item)
+
for bundlename in metadata.bundles:
- entries = [item for (key, item) in self.entries.items() if \
- self.patterns.match(os.path.basename(key)).group('name') == bundlename]
+ entries = bundle_entries[bundlename]
if len(entries) == 0:
continue
elif len(entries) == 1: