[SCM] build.samba.org - branch master updated

Jelmer Vernooij jelmer at samba.org
Fri Nov 19 11:05:40 MST 2010


The branch, master has been updated
       via  5478fec Cope with nonexistant hosts.
      from  2b0f377 Fix sorting, right builds in results.

http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 5478feccd4b740598a26d96a61cbe992241faf5b
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Fri Nov 19 19:05:18 2010 +0100

    Cope with nonexistant hosts.

-----------------------------------------------------------------------

Summary of changes:
 buildfarm/hostdb.py       |    3 +++
 buildfarm/web/__init__.py |   13 +++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildfarm/hostdb.py b/buildfarm/hostdb.py
index 24186c2..c037f2b 100644
--- a/buildfarm/hostdb.py
+++ b/buildfarm/hostdb.py
@@ -106,6 +106,9 @@ class HostDatabase(object):
         """Find a host by name."""
         raise NotImplementedError(self.host)
 
+    def __getitem__(self, name):
+        return self.host(name)
+
     def create_rsync_secrets(self):
         """Write out the rsyncd.secrets"""
         yield "# rsyncd.secrets file\n"
diff --git a/buildfarm/web/__init__.py b/buildfarm/web/__init__.py
index d1f7a74..9be4821 100755
--- a/buildfarm/web/__init__.py
+++ b/buildfarm/web/__init__.py
@@ -656,7 +656,7 @@ class ViewHostPage(BuildFarmPage):
     def _render_build_list_header(self, host):
         yield "<div class='host summary'>"
         yield "<a id='host' name='host'/>"
-        yield "<h3>%s - %s</h3>" % (host, self.buildfarm.hostdb.host(host).platform.encode("utf-8"))
+        yield "<h3>%s - %s</h3>" % (host.name, host.platform.encode("utf-8"))
         yield "<table class='real'>"
         yield "<thead><tr><th>Target</th><th>Build<br/>Revision</th><th>Build<br />Age</th><th>Status<br />config/build<br />install/test</th><th>Warnings</th></tr></thead>"
         yield "<tbody>"
@@ -679,8 +679,13 @@ class ViewHostPage(BuildFarmPage):
     def render_html(self, myself, *requested_hosts):
         yield "<div class='build-section' id='build-summary'>"
         yield '<h2>Host summary:</h2>'
-        for host in requested_hosts:
-            builds = list(self.buildfarm.get_host_builds(host))
+        for hostname in requested_hosts:
+            try:
+                host = self.buildfarm.hostdb.host(hostname)
+            except hostdb.NoSuchHost:
+                deadhosts.append(hostname)
+                continue
+            builds = list(self.buildfarm.get_host_builds(hostname))
             if len(builds) > 0:
                 yield "".join(self._render_build_list_header(host))
                 for build in builds:
@@ -688,7 +693,7 @@ class ViewHostPage(BuildFarmPage):
                 yield "</tbody></table>"
                 yield "</div>"
             else:
-                deadhosts.append(host)
+                deadhosts.append(hostname)
 
         yield "</div>"
         yield "".join(self.draw_dead_hosts(*deadhosts))


-- 
build.samba.org


More information about the samba-cvs mailing list