Skip to content

Commit

Permalink
Decode slave host & admin data as utf-8 (fixes buildbot#671)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-sonestedt committed Jan 7, 2010
1 parent 0102f5e commit d9699ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions buildbot/status/web/slaves.py
Expand Up @@ -64,7 +64,8 @@ def content(self, request, ctx):
control = self.getControl(request),
this_url = "../../../" + path_to_slave(request, slave),
access_uri = slave.getAccessURI()),
info = slave.getHost())
admin = unicode(slave.getAdmin() or '', 'utf-8'),
host = unicode(slave.getHost() or '', 'utf-8'))
template = request.site.buildbot_service.templates.get_template("buildslave.html")
data = template.render(**ctx)
return data
Expand Down Expand Up @@ -98,11 +99,10 @@ def content(self, request, ctx):
info['builders'] = [{'link': request.childLink("../builders/%s" % bname),
'name': bname}]
info['version'] = slave.getVersion()

info['connected'] = slave.isConnected()

if slave.isConnected():
info['admin'] = slave.getAdmin()
info['admin'] = unicode(slave.getAdmin(), 'utf-8')
last = slave.lastMessageReceived()
if last:
info['last_heard_from_age'] = abbreviate_age(time.time() - last)
Expand Down
9 changes: 7 additions & 2 deletions buildbot/status/web/templates/buildslave.html
Expand Up @@ -31,9 +31,14 @@ <h2>Recent builds</h2>
<a href="{{ access_uri|e }}">Click to Access Slave</a>
{% endif %}

{% if info %}
{% if admin %}
<h2>Administrator</h2>
<p>{{ admin|e|replace('@', '<span style="display:none">-ohnoyoudont-</span>@') }}</p>
{% endif %}

{% if host %}
<h2>Slave information</h2>
<pre>{{ info|e }}</pre>
<pre>{{ host|e }}</pre>
{% endif %}

{% if not slave.isConnected() %}
Expand Down

0 comments on commit d9699ca

Please sign in to comment.