"""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"
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>"
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:
yield "</tbody></table>"
yield "</div>"
else:
- deadhosts.append(host)
+ deadhosts.append(hostname)
yield "</div>"
yield "".join(self.draw_dead_hosts(*deadhosts))