summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2008-12-21 21:01:36 +0000
committerSol Jerome <solj@ices.utexas.edu>2008-12-21 21:01:36 +0000
commit1a2fbced68eaf6bb01d6dee6a4223c7368095137 (patch)
tree7cb55899ecba2d15708cc34f3e0f0e556f8f1baa /src
parent425cc2679d54ba90d24972356b988252461039bd (diff)
downloadbcfg2-1a2fbced68eaf6bb01d6dee6a4223c7368095137.tar.gz
bcfg2-1a2fbced68eaf6bb01d6dee6a4223c7368095137.tar.bz2
bcfg2-1a2fbced68eaf6bb01d6dee6a4223c7368095137.zip
Warn on missing bundles when using -b (Resolves Ticket #615) [bugfix]
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4997 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Client/Frame.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/lib/Client/Frame.py b/src/lib/Client/Frame.py
index 71c4addc8..014a1cf16 100644
--- a/src/lib/Client/Frame.py
+++ b/src/lib/Client/Frame.py
@@ -1,4 +1,7 @@
-'''Frame is the Client Framework that verifies and installs entries, and generates statistics'''
+"""
+Frame is the Client Framework that verifies and
+installs entries, and generates statistics
+"""
__revision__ = '$Revision$'
import logging, time, types
@@ -78,7 +81,8 @@ class Frame:
except Bcfg2.Client.Tools.toolInstantiationError:
continue
except:
- self.logger.error("Failed to instantiate tool %s" % (tool), exc_info=1)
+ self.logger.error("Failed to instantiate tool %s" % \
+ (tool), exc_info=1)
for tool in self.tools[:]:
for conflict in getattr(tool, 'conflicts', []):
@@ -90,7 +94,7 @@ class Frame:
if not self.dryrun and not self.setup['bundle']:
for cfile in [cfl for cfl in config.findall(".//ConfigFile") \
if cfl.get('name') in self.__important__]:
- tl= [t for t in self.tools if t.handlesEntry(cfile) \
+ tl = [t for t in self.tools if t.handlesEntry(cfile) \
and t.canVerify(cfile)]
if tl:
if not tl[0].VerifyConfigFile(cfile, []):
@@ -103,7 +107,8 @@ class Frame:
self.logger.error("Unexpected tool failure",
exc_info=1)
# find entries not handled by any tools
- problems = [entry for struct in config for entry in struct if entry not in self.handled]
+ problems = [entry for struct in config for \
+ entry in struct if entry not in self.handled]
if problems:
self.logger.error("The following entries are not handled by any tool:")
@@ -191,6 +196,12 @@ class Frame:
# Here is where most of the work goes
# first perform bundle filtering
if self.setup['bundle']:
+ all_bundle_names = [b.get('name') for b in
+ self.config.findall('./Bundle')]
+ # warn if non-existent bundle given
+ for bundle in self.setup['bundle']:
+ if bundle not in all_bundle_names:
+ self.logger.info("Warning: Bundle %s not found" % bundle)
bundles = [b for b in self.config.findall('./Bundle') \
if b.get('name') in self.setup['bundle']]
self.whitelist = [e for e in self.whitelist if \