diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2009-02-18 01:32:11 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2009-02-18 01:32:11 +0000 |
commit | e665d6ab163907331aad45a49b8082884d6000b1 (patch) | |
tree | 85a3e145c20bed33682df526f67c068b73ee7658 /src | |
parent | b40c80acdd1d19963837e887f94aff86f5e67708 (diff) | |
download | bcfg2-e665d6ab163907331aad45a49b8082884d6000b1.tar.gz bcfg2-e665d6ab163907331aad45a49b8082884d6000b1.tar.bz2 bcfg2-e665d6ab163907331aad45a49b8082884d6000b1.zip |
Implement improved client-side error checking (will allow better error messages in cases of bind failures, etc)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5082 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Client/Tools/RPMng.py | 14 | ||||
-rw-r--r-- | src/lib/Client/Tools/__init__.py | 10 |
2 files changed, 23 insertions, 1 deletions
diff --git a/src/lib/Client/Tools/RPMng.py b/src/lib/Client/Tools/RPMng.py index 6dca8e142..3d0522950 100644 --- a/src/lib/Client/Tools/RPMng.py +++ b/src/lib/Client/Tools/RPMng.py @@ -704,6 +704,12 @@ class RPMng(Bcfg2.Client.Tools.PkgTool): if not self.handlesEntry(entry): return False + if 'failure' in entry.attrib: + self.logger.error("Cannot install entry %s:%s with bind failure" % \ + (entry.tag, entry.get('name'))) + return False + + instances = entry.findall('Instance') # If the entry wasn't verifiable, then we really don't want to try and fix something @@ -780,8 +786,14 @@ class RPMng(Bcfg2.Client.Tools.PkgTool): if not self.handlesEntry(entry): return False + if 'failure' in entry.attrib: + self.logger.error("Entry %s:%s reports bind failure: %s" % \ + (entry.tag, entry.get('name'), entry.get('failure'))) + return False + # We don't want to do any checks so we don't care what the entry has in it. - if self.pkg_checks == 'false' or entry.get('pkg_checks', 'true').lower() == 'false': + if self.pkg_checks == 'false' or \ + entry.get('pkg_checks', 'true').lower() == 'false': return True instances = entry.findall('Instance') diff --git a/src/lib/Client/Tools/__init__.py b/src/lib/Client/Tools/__init__.py index d44356f9b..79d273fb3 100644 --- a/src/lib/Client/Tools/__init__.py +++ b/src/lib/Client/Tools/__init__.py @@ -164,6 +164,11 @@ class Tool: if not self.handlesEntry(entry): return False + if 'failure' in entry.attrib: + self.logger.error("Entry %s:%s reports bind failure: %s" % \ + (entry.tag, entry.get('name'), entry.get('failure'))) + return False + missing = [attr for attr in self.__req__[entry.tag] \ if attr not in entry.attrib] if missing: @@ -188,6 +193,11 @@ class Tool: if not self.handlesEntry(entry): return False + if 'failure' in entry.attrib: + self.logger.error("Cannot install entry %s:%s with bind failure" % \ + (entry.tag, entry.get('name'))) + return False + missing = [attr for attr in self.__ireq__[entry.tag] \ if attr not in entry.attrib or not entry.attrib[attr]] if missing: |