From 4e624353f087c11d57d668dab1a7e8a6f9a3eeaf Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Tue, 10 Aug 2004 19:44:12 +0000 Subject: handle nonexistent bundles properly (Logical change 1.27) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@139 ce84e21b-d406-0410-9b95-82705330c041 --- src/bundler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/bundler.py b/src/bundler.py index 7337433c9..0326ea7c4 100644 --- a/src/bundler.py +++ b/src/bundler.py @@ -2,6 +2,7 @@ # $Id: $ from copy import deepcopy +from syslog import LOG_ERR, syslog from GeneratorUtils import XMLFileBacked, DirectoryBacked from Structure import Structure @@ -38,7 +39,11 @@ class bundler(Structure): (system, package, service) = self.GetTransInfo(metadata) bundleset = [] for bundlename in metadata.bundles: - bundle = self.bundles.entries["%s.xml"%(bundlename)] + if self.bundles.entries.has_key("%s.xml"%(bundlename)): + bundle = self.bundles.entries["%s.xml"%(bundlename)] + else: + syslog(LOG_ERR, "Client %s requested nonexistent bundle %s"%(metadata.hostname, bundlename)) + continue b = Element("Bundle", name=bundlename) for entry in bundle.entries: if entry.tag != 'System': -- cgit v1.2.3-1-g7c22