Add convenience method for host URIs.
authorjelmer@samba.org <jelmer@samba.org>
Tue, 23 Nov 2010 14:42:59 +0000 (15:42 +0100)
committerjelmer@samba.org <jelmer@samba.org>
Tue, 23 Nov 2010 14:42:59 +0000 (15:42 +0100)
buildfarm/web/__init__.py
mail-dead-hosts.py

index ed665cc226904bb096c9902a7fa10749aa89be46..55c28292f390373dbc1077fe5c6b5bf7c0a0d564 100755 (executable)
@@ -135,9 +135,11 @@ def build_link(myself, build):
     return "<a href='%s'>%s</a>" % (build_uri(myself, build), html_build_status(build.status()))
 
 
+def host_uri(myself, host):
+    return "%s?function=View+Host;host=%s" % (myself, host)
+
 def host_link(myself, host):
-    return "<a href='%s?function=View+Host;host=%s'>%s</a>" % (
-        myself, host, host)
+    return "<a href='%s'>%s</a>" % (host_uri(myself, host), host)
 
 
 def revision_link(myself, revision, tree):
index ceebef2e4d35ee619776ea7792ff145a6e39a0be..22f7bcac321100076b6ebc959228ced543dff8a5 100755 (executable)
@@ -18,6 +18,7 @@
 #
 
 from buildfarm.sqldb import StormCachingBuildFarm
+from buildfarm.web import host_uri
 import optparse
 import smtplib
 from email.MIMEText import MIMEText
@@ -53,13 +54,12 @@ If you no longer wish your host to participate in the Samba Build
 Farm, then please let us know so we can remove its records.
 
 You can see the summary for your host at:
-http://build.samba.org/?function=View+Host;host=%s
 
 Thanks,
 
 The Build Farm administration team.
 
-""" % (host.name, last_update, host.name)
+""" % (host.name, last_update, host_uri("http://build.samba.org/build.cgi", host.name))
 
     msg = MIMEText(body)