Changeset - 5376baf8cd6b
[Not reviewed]
default
0 5 0
Mads Kiilerich - 11 years ago 2014-07-18 17:01:37
madski@unity3d.com
logging: use official log.warning instead of log.warn
5 files changed with 7 insertions and 7 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/auth.py
Show inline comments
 
@@ -762,24 +762,24 @@ class LoginRequired(object):
 
                log.debug('API KEY ****%s is VALID' % _api_key[-4:])
 
            else:
 
                api_access_valid = False
 
                if not _api_key:
 
                    log.debug("API KEY *NOT* present in request")
 
                else:
 
                    log.warn("API KEY ****%s *NOT* valid" % _api_key[-4:])
 
                    log.warning("API KEY ****%s *NOT* valid" % _api_key[-4:])
 

	
 
        log.debug('Checking if %s is authenticated @ %s' % (user.username, loc))
 
        reason = 'RegularAuth' if user.is_authenticated else 'APIAuth'
 

	
 
        if ip_access_valid and (user.is_authenticated or api_access_valid):
 
            log.info('user %s authenticating with:%s IS authenticated on func %s '
 
                     % (user, reason, loc)
 
            )
 
            return func(*fargs, **fkwargs)
 
        else:
 
            log.warn('user %s authenticating with:%s NOT authenticated on func: %s: '
 
            log.warning('user %s authenticating with:%s NOT authenticated on func: %s: '
 
                     'IP_ACCESS:%s API_ACCESS:%s'
 
                     % (user, reason, loc, ip_access_valid, api_access_valid)
 
            )
 
            p = url.current()
 

	
 
            log.debug('redirecting to login page with %s' % p)
kallithea/lib/auth_modules/auth_internal.py
Show inline comments
 
@@ -61,13 +61,13 @@ class KallitheaAuthPlugin(auth_modules.K
 

	
 
    def auth(self, userobj, username, password, settings, **kwargs):
 
        if not userobj:
 
            log.debug('userobj was:%s skipping' % (userobj, ))
 
            return None
 
        if userobj.extern_type != self.name:
 
            log.warn("userobj:%s extern_type mismatch got:`%s` expected:`%s`"
 
            log.warning("userobj:%s extern_type mismatch got:`%s` expected:`%s`"
 
                     % (userobj, userobj.extern_type, self.name))
 
            return None
 

	
 
        user_attrs = {
 
            "username": userobj.username,
 
            "firstname": userobj.firstname,
kallithea/lib/auth_modules/auth_pam.py
Show inline comments
 
@@ -129,12 +129,12 @@ class KallitheaAuthPlugin(auth_modules.K
 
            regex = settings["gecos"]
 
            match = re.search(regex, user_data.pw_gecos)
 
            if match:
 
                user_attrs["firstname"] = match.group('first_name')
 
                user_attrs["lastname"] = match.group('last_name')
 
        except Exception:
 
            log.warn("Cannot extract additional info for PAM user")
 
            log.warning("Cannot extract additional info for PAM user")
 
            pass
 

	
 
        log.debug("pamuser: \n%s" % formatted_json(user_attrs))
 
        log.info('user %s authenticated correctly' % user_attrs['username'])
 
        return user_attrs
kallithea/lib/db_manage.py
Show inline comments
 
@@ -469,13 +469,13 @@ class DbManage(object):
 
        if not os.access(path, os.R_OK):
 
            path_ok = False
 
            log.error('Given path %s is not readable' % (path,))
 

	
 
        # check write access, warn user about non writeable paths
 
        elif not os.access(path, os.W_OK) and path_ok:
 
            log.warn('No write permission to given path %s' % (path,))
 
            log.warning('No write permission to given path %s' % (path,))
 
            if not ask_ok('Given path %s is not writeable, do you want to '
 
                          'continue with read only mode ? [y/n]' % (path,)):
 
                log.error('Canceled by user')
 
                sys.exit(-1)
 

	
 
        if retries == 0:
kallithea/lib/utils.py
Show inline comments
 
@@ -234,16 +234,16 @@ def get_filesystem_repos(path, recursive
 
    # remove ending slash for better results
 
    path = path.rstrip(os.sep)
 
    log.debug('now scanning in %s location recursive:%s...' % (path, recursive))
 

	
 
    def _get_repos(p):
 
        if not os.access(p, os.R_OK) or not os.access(p, os.X_OK):
 
            log.warn('ignoring repo path without access: %s' % (p,))
 
            log.warning('ignoring repo path without access: %s' % (p,))
 
            return
 
        if not os.access(p, os.W_OK):
 
            log.warn('repo path without write access: %s' % (p,))
 
            log.warning('repo path without write access: %s' % (p,))
 
        for dirpath in os.listdir(p):
 
            if os.path.isfile(os.path.join(p, dirpath)):
 
                continue
 
            cur_path = os.path.join(p, dirpath)
 

	
 
            # skip removed repos
0 comments (0 inline, 0 general)