From bbcbf52af250e66cc5e5a74a1969ac5fe613ff71 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Mon, 30 Jul 2007 14:54:23 +0000 Subject: Change incomplete entry reason to be an error, and include all missing attributes (Resolves Ticket #474) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3579 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Client/Tools/__init__.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/lib/Client/Tools/__init__.py b/src/lib/Client/Tools/__init__.py index 20d32519e..06473d273 100644 --- a/src/lib/Client/Tools/__init__.py +++ b/src/lib/Client/Tools/__init__.py @@ -157,10 +157,13 @@ class Tool: if not self.handlesEntry(entry): return False - if [attr for attr in self.__req__[entry.tag] if attr not in entry.attrib]: + missing = [attr for attr in self.__req__[entry.tag] \ + if attr not in entry.attrib] + if missing: self.logger.error("Incomplete information for entry %s:%s; cannot verify" \ % (entry.tag, entry.get('name'))) - self.logger.debug("\t... due to absense of %s attribute" % attr) + self.logger.error("\t... due to absense of %s attribute(s)" % \ + (":".join(missing))) return False return True @@ -173,10 +176,14 @@ class Tool: '''test if entry has enough information to be installed''' if not self.handlesEntry(entry): return False - if [attr for attr in self.__ireq__[entry.tag] if attr not in entry.attrib]: + + missing = [attr for attr in self.__ireq__[entry.tag] \ + if attr not in entry.attrib] + if missing: self.logger.error("Incomplete information for entry %s:%s; cannot install" \ % (entry.tag, entry.get('name'))) - self.logger.debug("\t... due to absense of %s attribute" % attr) + self.logger.error("\t... due to absense of %s attribute" % \ + (":".join(missing))) return False return True -- cgit v1.2.3-1-g7c22