From 7cd8897812bfbb5511c46573739da22a4073fb24 Mon Sep 17 00:00:00 2001 From: Matt Hart Date: Mon, 16 Nov 2015 13:35:59 +0000 Subject: Fixed some typos and made work with older requests version Change-Id: Ia3fd209810d6467119823caec8063afb158ad479 --- bugzilla-post-receive.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bugzilla-post-receive.py b/bugzilla-post-receive.py index 11a8100..552cf20 100755 --- a/bugzilla-post-receive.py +++ b/bugzilla-post-receive.py @@ -27,16 +27,16 @@ HEADERS = {"Content-Type": "application/json", "Accept": "application/json"} BUGZILLA_REST = "%s/rest" % args.base BUGZILLA_LINK_BASE = "%s/show_bug.cgi?id=" % args.base GIT_URL_BASE = "https://git.linaro.org" -GIT_DIR_BASE = "/srv/respositories" +GIT_DIR_BASE = "/srv/repositories" def generate_web_url(rev): - pwd = os.environ["PWD"] + pwd = os.getcwd() if re.match(GIT_DIR_BASE, pwd): dir = pwd.split(GIT_DIR_BASE)[1] else: dir = pwd - return "%s%s.git/commit/%s" % (GIT_URL_BASE, dir, rev) + return "%s%s/commit/%s" % (GIT_URL_BASE, dir, rev) def do_put(url, data): @@ -49,7 +49,7 @@ def set_resolved_fixed(id): data = {"status": "RESOLVED", "resolution": "FIXED"} result = requests.put(url, json.dumps(data), headers=HEADERS) if result.status_code == 200: - data = json.loads(result.text) + data = json.loads(result.content) changes = data["bugs"][0]["changes"] if len(changes) > 0: return True -- cgit v1.2.3