From f42f2f44ae47e9e83b16cb15569d1bab23cbceb9 Mon Sep 17 00:00:00 2001 From: kaou Date: Mon, 21 Jan 2019 20:01:50 +0000 Subject: [PATCH] Fixed repository regular expression, fixed error message getter --- buildbot_gitea/reporter.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/buildbot_gitea/reporter.py b/buildbot_gitea/reporter.py index 56a44dd..69fc3b9 100644 --- a/buildbot_gitea/reporter.py +++ b/buildbot_gitea/reporter.py @@ -25,7 +25,7 @@ import re class GiteaStatusPush(http.HttpStatusPushBase): name = "GiteaStatusPush" neededDetails = dict(wantProperties=True) - ssh_url_match = re.compile(r"(ssh://)?[\w+\-\_]+@[\w+\.\-\_]:?\d*/(?P[\w_\-\.]+)/(?P[\w_\-\.]+)\.git") + ssh_url_match = re.compile(r"(ssh://)?[\w+\-\_]+@[\w\.\-\_]+:?(\d*/)?(?P[\w_\-\.]+)/(?P[\w_\-\.]+)(\.git)?") @defer.inlineCallbacks def reconfigService(self, baseURL, token, @@ -157,12 +157,13 @@ class GiteaStatusPush(http.HttpStatusPushBase): ) if res.code not in (200, 201, 204): message = yield res.json() - message = message.get('message', 'unspecified error') + message = message[0].get('message', 'unspecified error') log.msg( 'Could not send status "{state}" for ' - '{repo} at {sha}: {message}'.format( + '{repo} at {sha}: {code} : {message}'.format( state=state, repo=sourcestamp['repository'], sha=sha, + code=res.code, message=message)) elif self.verbose: log.msg(