summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Joseph Barnhart Clark <dclark@pobox.com>2007-07-06 05:36:57 +0000
committerDaniel Joseph Barnhart Clark <dclark@pobox.com>2007-07-06 05:36:57 +0000
commitb5a0f5fb9b4dbe999395777a13b0f1dc85c75c3d (patch)
tree0415f7a211d6dbf0c305b2027e359075bfa42714 /src
parentc7d0b780c22fb97946cc10454509299f6322ef21 (diff)
downloadbcfg2-b5a0f5fb9b4dbe999395777a13b0f1dc85c75c3d.tar.gz
bcfg2-b5a0f5fb9b4dbe999395777a13b0f1dc85c75c3d.tar.bz2
bcfg2-b5a0f5fb9b4dbe999395777a13b0f1dc85c75c3d.zip
Added debugging when verify or install fails due to lack of an attribute.
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3421 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Client/Tools/__init__.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/lib/Client/Tools/__init__.py b/src/lib/Client/Tools/__init__.py
index 1ab656481..5105a68f4 100644
--- a/src/lib/Client/Tools/__init__.py
+++ b/src/lib/Client/Tools/__init__.py
@@ -2,8 +2,8 @@
__revision__ = '$Revision$'
__all__ = ["Action", "APT", "Blast", "Chkconfig", "DebInit", "Encap",
- "FreeBSDPackage", "launchd", "Portage", "POSIX", "RPM",
- "RPMng", 'rpmtools', "RcUpdate", "SMF", "SYSV", "Yum",
+ "FreeBSDPackage", "launchd", "Portage", "POSIX", "RPM",
+ "RPMng", 'rpmtools', "RcUpdate", "SMF", "SYSV", "Yum",
"YUMng"]
drivers = [item for item in __all__ if item not in ['rpmtools']]
@@ -37,7 +37,7 @@ class executor:
'''this class runs stuff for us'''
def __init__(self, logger):
self.logger = logger
-
+
def run(self, command):
'''Run a command in a pipe dealing with stdout buffer overloads'''
self.logger.debug('> %s' % command)
@@ -69,7 +69,7 @@ class Tool:
__handles__ = []
__req__ = {}
__important__ = []
-
+
def __init__(self, logger, setup, config, states):
self.setup = setup
self.logger = logger
@@ -140,7 +140,7 @@ class Tool:
'''return a list of supported entries'''
return [entry for struct in self.config.getchildren() for entry in struct.getchildren() \
if self.handlesEntry(entry)]
-
+
def handlesEntry(self, entry):
'''return if entry is handled by this Tool'''
return (entry.tag, entry.get('type')) in self.__handles__
@@ -156,10 +156,11 @@ class Tool:
'''test if entry has enough information to be verified'''
if not self.handlesEntry(entry):
return False
-
+
if [attr for attr in self.__req__[entry.tag] if attr not in entry.attrib]:
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)
return False
return True
@@ -175,9 +176,10 @@ class Tool:
if [attr for attr in self.__ireq__[entry.tag] if attr not in entry.attrib]:
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)
return False
return True
-
+
class PkgTool(Tool):
'''PkgTool provides a one-pass install with fallback for use with packaging systems'''
pkgtool = ('echo %s', ('%s', ['name']))
@@ -194,7 +196,7 @@ class PkgTool(Tool):
def VerifyPackage(self, dummy, _):
'''Dummy verification method'''
return False
-
+
def Install(self, packages):
'''Run a one-pass install, followed by single pkg installs in case of failure'''
self.logger.info("Trying single pass package install for pkgtype %s" % \