diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2007-08-09 15:19:18 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2007-08-09 15:19:18 +0000 |
commit | 31fe8d82af6568318926789b6ccc3100b74e839e (patch) | |
tree | 0fff287d5afcb94e521227505d49bbc289d14c28 /src/lib/Client | |
parent | d505c26c1d2c24c55c61754cc480a6fc7095a878 (diff) | |
download | bcfg2-31fe8d82af6568318926789b6ccc3100b74e839e.tar.gz bcfg2-31fe8d82af6568318926789b6ccc3100b74e839e.tar.bz2 bcfg2-31fe8d82af6568318926789b6ccc3100b74e839e.zip |
Fix posix error paths
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3622 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client')
-rw-r--r-- | src/lib/Client/Tools/POSIX.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/Client/Tools/POSIX.py b/src/lib/Client/Tools/POSIX.py index 30bd1483b..ff3492302 100644 --- a/src/lib/Client/Tools/POSIX.py +++ b/src/lib/Client/Tools/POSIX.py @@ -5,7 +5,7 @@ from stat import S_ISVTX, S_ISGID, S_ISUID, S_IXUSR, S_IWUSR, S_IRUSR, S_IXGRP from stat import S_IWGRP, S_IRGRP, S_IXOTH, S_IWOTH, S_IROTH, ST_MODE, S_ISDIR from stat import S_IFREG, ST_UID, ST_GID, S_ISREG, S_IFDIR, S_ISLNK, ST_MTIME -import binascii, difflib, grp, os, pwd, string +import binascii, difflib, grp, os, pwd, string, logging import Bcfg2.Client.Tools def calcPerms(initial, perms): @@ -22,6 +22,8 @@ def calcPerms(initial, perms): tempperms |= perm return tempperms +log = logging.getLogger('posix') + def normUid(entry): '''This takes a user name or uid and returns the corrisponding uid or False''' try: @@ -30,7 +32,7 @@ def normUid(entry): except: return int(pwd.getpwnam(entry.get('owner'))[2]) except (OSError, KeyError): - self.logger.error('UID normalization failed for %s' % (entry.get('name'))) + log.error('UID normalization failed for %s' % (entry.get('name'))) return False def normGid(entry): @@ -41,7 +43,8 @@ def normGid(entry): except: return int(grp.getgrnam(entry.get('group'))[2]) except (OSError, KeyError): - self.logger.error('GID normalization failed for %s' % (entry.get('name'))) + + log.error('GID normalization failed for %s' % (entry.get('name'))) return False text_chars = "".join(map(chr, range(32, 127)) + list("\n\r\t\b")) |