From 13878f84b50a0848e957aed69f8b240202232684 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Tue, 30 Nov 2004 23:02:50 +0000 Subject: 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 --- src/lib/Client/Toolset.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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): -- cgit v1.2.3-1-g7c22