aboutsummaryrefslogtreecommitdiff
path: root/bugzilla-post-receive.py
diff options
context:
space:
mode:
Diffstat (limited to 'bugzilla-post-receive.py')
-rwxr-xr-xbugzilla-post-receive.py8
1 files 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