From 22713f24e1c97792882a34f036d754e89eb5d0cc Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 3 Jul 2019 17:32:36 +0300 Subject: Change: improve vcsworker.py logging a bit --- vcsworker.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vcsworker.py b/vcsworker.py index 0c7ff9e..5983268 100755 --- a/vcsworker.py +++ b/vcsworker.py @@ -133,10 +133,10 @@ class API: def check(self, func, required_scopes, kwargs): '''Call a callback function, if it's OK to do so''' r = bottle.request - logging.debug('Checking access for request %s %s', r.method, r.path) + logging.debug('New request, checking access: %s %s', r.method, r.path) - if self._checker.access_is_allowed(bottle.request.headers, required_scopes): - logging.info('Serving request %s %s', r.method, r.path) + if self._checker.access_is_allowed(r.headers, required_scopes): + logging.info('Access is allowed: %s %s', r.method, r.path) ret = func(**kwargs) logging.info('Result: %r', ret) return ret @@ -203,10 +203,11 @@ class VCSWorker(API): def _update_repo(self): spec = bottle.request.json + logging.info('Updating repository: %r', spec) + url = spec['git'] ref = spec['ref'] name = spec['gitlab'] - dirname = os.path.join(self._tmpdir, name) if self._clone(url, ref, dirname): @@ -217,7 +218,6 @@ class VCSWorker(API): dirname, self.GITLAB_DOMAIN, self.GITLAB_PROJECT, ref, name) if ok: - logging.info('Repository copied successfully') return 'Repository copied successfully' logging.error('Something went wrong when copying repository') @@ -253,7 +253,7 @@ def runcmd(cwd, argv, timeout): logging.error('Command took too long (timeout %r)', timeout) return False except Exception as e: - logging.error('Error during git clone: %s', str(e)) + logging.error('Error while running command: %s', str(e)) return False if p.returncode != 0: -- cgit v1.2.1