summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2004-11-30 23:02:50 +0000
committerNarayan Desai <desai@mcs.anl.gov>2004-11-30 23:02:50 +0000
commit13878f84b50a0848e957aed69f8b240202232684 (patch)
treede8972d2a50ce3a64d0c2b3116e407c1a39cec89
parentb6b22a448846ddc014dbfc4f780ae0b93b128af6 (diff)
downloadbcfg2-13878f84b50a0848e957aed69f8b240202232684.tar.gz
bcfg2-13878f84b50a0848e957aed69f8b240202232684.tar.bz2
bcfg2-13878f84b50a0848e957aed69f8b240202232684.zip
add debugging for Directory Verification
(Logical change 1.154) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@689 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r--src/lib/Client/Toolset.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/Client/Toolset.py b/src/lib/Client/Toolset.py
index 20895ce28..7c42232a2 100644
--- a/src/lib/Client/Toolset.py
+++ b/src/lib/Client/Toolset.py
@@ -174,11 +174,13 @@ class Toolset(object):
try:
ondisk = stat(entry.get('name'))
except OSError:
+ self.CondPrint("debug", "Directory %s does not exist" % (entry.get('name')))
return False
try:
owner = getpwuid(ondisk[ST_UID])[0]
group = getgrgid(ondisk[ST_GID])[0]
except OSError:
+ self.CondPrint('debug', 'User resolution failing')
owner = 'root'
group = 'root'
perms = stat(entry.get('name'))[ST_MODE]
@@ -187,6 +189,12 @@ class Toolset(object):
(perms == calc_perms(S_IFDIR, entry.get('perms')))):
return True
else:
+ if owner != entry.get('owner'):
+ self.CondPrint("debug", "Directory %s ownership wrong" % (entry.get('name')))
+ if group != entry.get('group'):
+ self.CondPrint("debug", "Directory %s group wrong" % (entry.get('name')))
+ if perms != calc_perms(S_IFDIR, entry.get('perms')):
+ self.CondPrint("debug", "Directory %s permissions wrong" % (entry.get('name')))
return False
def InstallDirectory(self, entry):