~oubiwann/txloadbalancer/0.9.0

« back to all changes in this revision

Viewing changes to pydirector/pdadmin.py

  • Committer: Duncan McGreggor
  • Date: 2008-06-21 05:31:24 UTC
  • Revision ID: oubiwann@lorien-20080621053124-cxp2f7hfs373gmo5
Moved bad host info into template.

Show diffs side-by-side

added added

removed removed

Lines of Context:
369
369
                        urllib.quote(group.name), urllib.quote(h)))
370
370
                bad = stats['bad']
371
371
                if bad:
372
 
                    W('''<tr class="%s"><th colspan="2">disabled hosts</th>
373
 
                         <th>why</th><th>when</th></tr>\n'''%klass)
 
372
                    W(template.badHostGroup % klass)
374
373
                for k in bad.keys():
375
 
                    host = '%s:%s'%k
376
 
                    W('<tr class="%s"><td>'%klass)
377
 
                    W("%s</td><td><tt>%s</tt></td>\n"%(hdict[host], host)) # XXXX
378
 
                    when,what = bad[k]
379
 
                    W("<td>%s</td><td>--</td>"%what)
380
 
                    W('</tr>')
381
 
            W("</table>")
 
374
                    host = '%s:%s' % k
 
375
                    when, what = bad[k]
 
376
                    W(template.badHostInfo % (klass, hdict[host], host, what))
 
377
            W(template.serviceClose)
382
378
        self.footer(resultmessage)
383
379
 
384
380
    def pdadmin_addHost(self, service, group, name, ip, Access='Write'):