From f40c9a40effa2706896579a6cc07a2a1448b9335 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Fri, 25 Jan 2008 03:52:36 +0000 Subject: Harden handling if __important__ entries (reported by SolJ) [bugfix] git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4289 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Client/Frame.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/lib/Client/Frame.py b/src/lib/Client/Frame.py index 92fa3ca7b..a164e9d2e 100644 --- a/src/lib/Client/Frame.py +++ b/src/lib/Client/Frame.py @@ -80,10 +80,15 @@ class Frame: if not self.dryrun: for cfile in [cfl for cfl in config.findall(".//ConfigFile") \ if cfl.get('name') in self.__important__]: - tool = [t for t in self.tools if t.handlesEntry(cfile)][0] - self.states[cfile] = tool.VerifyConfigFile(cfile, []) - if not self.states[cfile]: - tool.InstallConfigFile(cfile) + tl= [t for t in self.tools if t.handlesEntry(cfile) \ + and t.canVerify(cfile)] + if tl: + if not tl[0].VerifyConfigFile(cfile, []): + try: + self.states[cfile] = tool.InstallConfigFile(cfile) + except: + 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] -- cgit v1.2.3-1-g7c22