aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Hart <matthew.hart@linaro.org>2015-11-16 13:35:59 +0000
committerMatt Hart <matthew.hart@linaro.org>2015-11-16 13:35:59 +0000
commit7cd8897812bfbb5511c46573739da22a4073fb24 (patch)
tree81e059cb242d85e3d9a64aa6c5bb1df0c515e882
parent89175994028df15a480314fe478f26e6cf4e630e (diff)
downloadlinaro-git-tools-7cd8897812bfbb5511c46573739da22a4073fb24.tar.gz
Fixed some typos and made work with older requests version
Change-Id: Ia3fd209810d6467119823caec8063afb158ad479
-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