diff options
author | Lars Wirzenius <lwirzenius@wikimedia.org> | 2019-07-03 17:32:36 +0300 |
---|---|---|
committer | Lars Wirzenius <lwirzenius@wikimedia.org> | 2019-07-03 17:32:36 +0300 |
commit | 22713f24e1c97792882a34f036d754e89eb5d0cc (patch) | |
tree | 3ebea9de66b5978971c8f456e3950a167c4abf99 | |
parent | 052bf7a7dee421830b09f28a570fc2472e30571c (diff) | |
download | wmf-ci-arch-22713f24e1c97792882a34f036d754e89eb5d0cc.tar.gz |
Change: improve vcsworker.py logging a bit
-rwxr-xr-x | vcsworker.py | 12 |
1 files 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: |