Skip to content

Commit

Permalink
Merge branch 'master' of github.com:buildbot/buildbot
Browse files Browse the repository at this point in the history
* 'master' of github.com:buildbot/buildbot:
  use 'gerrit' as who, when gerrit strem-event does not provide a submitter
  fix unicode handling for gerrit stream-events
  • Loading branch information
djmitche committed Apr 23, 2011
2 parents dbc48d9 + f48c37c commit 09e8a0d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions master/buildbot/changes/gerritchangesource.py
Expand Up @@ -90,7 +90,7 @@ def processEnded(self, status_object):

def lineReceived(self, line):
try:
event = json.loads(line)
event = json.loads(line.decode('utf-8'))
except ValueError:
log.msg("bad json line: %s" % (line,))
return defer.succeed(None)
Expand Down Expand Up @@ -122,8 +122,13 @@ def flatten(event, base, d):
properties=properties)
elif event["type"] == "ref-updated":
ref = event["refUpdate"]
who = "gerrit"

if "submitter" in event:
who="%s <%s>" % (event["submitter"]["name"], event["submitter"]["email"])

chdict = dict(
who="%s <%s>" % (event["submitter"]["name"], event["submitter"]["email"]),
who=who,
project=ref["project"],
branch=ref["refName"],
revision=ref["newRev"],
Expand Down

0 comments on commit 09e8a0d

Please sign in to comment.