[Buildbot] #2906: Check the situation w/ HTML logs
Buildbot trac
trac at buildbot.net
Wed Sep 17 13:27:17 UTC 2014
#2906: Check the situation w/ HTML logs
-----------------------------+-------------------
Reporter: sa2ajj | Owner:
Type: enhancement | Status: new
Priority: patches-accepted | Milestone: 0.8.x
Version: 0.8.9 | Keywords:
-----------------------------+-------------------
Relevant part of IRC chat starts at
http://irclogs.jackgrigg.com/irc.freenode.net/buildbot/2014-09-17#i_3452473
As a basis, the http://pastebin.com/4Wh9DBux was used (attached).
Ended up with:
{{{
def setupLogfiles(self, cmd, logfiles):
for logname,remotefilename in logfiles.items():
if self.lazylogfiles:
# Ask RemoteCommand to watch a logfile, but only add
# it when/if we see any data.
#
# The dummy default argument local_logname is a work-
around for
# Python name binding; default values are bound by value,
but
# captured variables in the body are bound by name.
callback = lambda cmd_arg, local_logname=logname:
self.addHTMLOrTextLog(local_logname, remotefilename)
cmd.useLogDelayed(logname, callback, True)
else:
# tell the BuildStepStatus to add a LogFile
newlog = self.addHTMLOrTextLog(logname, remotefilename)
# and tell the RemoteCommand to feed it
cmd.useLog(newlog, True)
def addHTMLOrTextLog(self, logname, remotefilename):
if ( remotefilename.lower().endswith( ".html" ) ):
html = "" # addHTMLLog requires html arg, but in this
case, the actual contents are being added from the slave later.
newlog = self.addHTMLLog(logname, html)
else:
# tell the BuildStepStatus to add a LogFile
newlog = self.addLog(logname)
return newlog
}}}
--
Ticket URL: <http://trac.buildbot.net/ticket/2906>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation
More information about the bugs
mailing list