aboutsummaryrefslogtreecommitdiff
path: root/gitosis
diff options
context:
space:
mode:
authorTommi Virtanen <tv@eagain.net>2007-06-04 14:22:43 +0300
committerTommi Virtanen <tv@eagain.net>2007-06-04 14:22:43 +0300
commit8d69bf23fac4745816be2ea741ceacb19fe35605 (patch)
tree0ac30d0d559250268edcef344c17ef1d06fbc860 /gitosis
parentAdd a simple TODO list. (diff)
downloadgitosis-dakkar-8d69bf23fac4745816be2ea741ceacb19fe35605.tar.gz
gitosis-dakkar-8d69bf23fac4745816be2ea741ceacb19fe35605.tar.bz2
gitosis-dakkar-8d69bf23fac4745816be2ea741ceacb19fe35605.zip
Add debug logging to haveAccess.
Diffstat (limited to 'gitosis')
-rw-r--r--gitosis/access.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/gitosis/access.py b/gitosis/access.py
index 14280ad..1146c2d 100644
--- a/gitosis/access.py
+++ b/gitosis/access.py
@@ -1,3 +1,4 @@
+import logging
from ConfigParser import NoSectionError, NoOptionError
from gitosis import group
@@ -12,6 +13,16 @@ def haveAccess(config, user, mode, path):
Returns ``None`` for no access, or the physical repository path
for access granted to that repository.
"""
+ log = logging.getLogger('gitosis.access.haveAccess')
+
+ log.debug(
+ 'Access check for %(user)r as %(mode)r on %(path)r...'
+ % dict(
+ user=user,
+ mode=mode,
+ path=path,
+ ))
+
for groupname in group.getMembership(config=config, user=user):
try:
repos = config.get('group %s' % groupname, mode)
@@ -21,6 +32,13 @@ def haveAccess(config, user, mode, path):
repos = repos.split()
if path in repos:
+ log.debug(
+ 'Access ok for %(user)r as %(mode)r on %(path)r'
+ % dict(
+ user=user,
+ mode=mode,
+ path=path,
+ ))
return path
try:
@@ -29,4 +47,12 @@ def haveAccess(config, user, mode, path):
except (NoSectionError, NoOptionError):
pass
else:
+ log.debug(
+ 'Access ok for %(user)r as %(mode)r on %(path)r=%(mapping)r'
+ % dict(
+ user=user,
+ mode=mode,
+ path=path,
+ mapping=mapping,
+ ))
return mapping