[Buildbot] #2930: New-style class in 0.8.9 always results in exception in logfile

Buildbot trac trac at buildbot.net
Tue Oct 7 22:40:14 UTC 2014


#2930: New-style class in 0.8.9 always results in exception in logfile
--------------------+-----------------------
Reporter:  vlovich  |       Owner:  dustin
    Type:  defect   |      Status:  assigned
Priority:  major    |   Milestone:  0.8.x
 Version:  0.8.9    |  Resolution:
Keywords:           |
--------------------+-----------------------
Changes (by dustin):

 * owner:   => dustin
 * status:  new => assigned
 * milestone:  undecided => 0.8.x


Old description:

> class MyStep(BuildStep, ShellMixin):
>    def __init__(self, script, **kwargs):
>        self._script = script
>        kwargs = self.setupShellMixin(kwargs,prohibitArgs=['command'])
>        BuildStep.__init__(self, **kwargs)
>
>    @defer.inlineCallbacks
>    def run(self):
>        cmd = yield self.makeRemoteShellCommand(command=[self._script],
>                                                collectStdout=True,
>                                                collectStderr=True)
>        yield self.runCommand(cmd)
>        if cmd.didFail():
>            defer.returnValue(cmd.results())
>        // do something with cmd.stdout
>
> When I add MyStep to my factory, the stdio log file contains the
> exception below
>
> web.Server Traceback (most recent call last):
> exceptions.AssertionError: not available in new-style steps
>  <python framework>/Extras/lib/python/twisted/web/server.py:189 in
> process
>    188                              self._encoder = encoder
>    189                      self.render(resrc)
>    190                  except:
>
>  <python framework>/Extras/lib/python/twisted/web/server.py:238 in render
>    237                  try:
>    238                      body = resrc.render(self)
>    239                  except UnsupportedMethod as e:
>
>  <python framework>/Extras/lib/python/twisted/web/resource.py:250 in
> render
>    249                      raise UnsupportedMethod(allowedMethods)
>    250                  return m(request)
>    251
>
>  <packages>/site-packages/buildbot/status/web/logs.py:140 in render_GET
>     139
>     140         self.original.subscribeConsumer(ChunkConsumer(req, self))
>     141         return server.NOT_DONE_YET
>
>   <packages>/buildbot/status/logfile.py:436 in subscribeConsumer
>     435 def subscribeConsumer(self, consumer):
>     436 assert not self._isNewStyle, "not available in new-style steps"
>     437 p = LogFileProducer(self, consumer)
>  exceptions.AssertionError: not available in new-style steps

New description:

 {{{
 class MyStep(BuildStep, ShellMixin):
    def __init__(self, script, **kwargs):
        self._script = script
        kwargs = self.setupShellMixin(kwargs,prohibitArgs=['command'])
        BuildStep.__init__(self, **kwargs)

    @defer.inlineCallbacks
    def run(self):
        cmd = yield self.makeRemoteShellCommand(command=[self._script],
                                                collectStdout=True,
                                                collectStderr=True)
        yield self.runCommand(cmd)
        if cmd.didFail():
            defer.returnValue(cmd.results())
        // do something with cmd.stdout
 }}}

 When I add MyStep to my factory, the stdio log file contains the exception
 below

 {{{
 web.Server Traceback (most recent call last):
 exceptions.AssertionError: not available in new-style steps
  <python framework>/Extras/lib/python/twisted/web/server.py:189 in process
    188                              self._encoder = encoder
    189                      self.render(resrc)
    190                  except:

  <python framework>/Extras/lib/python/twisted/web/server.py:238 in render
    237                  try:
    238                      body = resrc.render(self)
    239                  except UnsupportedMethod as e:

  <python framework>/Extras/lib/python/twisted/web/resource.py:250 in
 render
    249                      raise UnsupportedMethod(allowedMethods)
    250                  return m(request)
    251

  <packages>/site-packages/buildbot/status/web/logs.py:140 in render_GET
     139
     140         self.original.subscribeConsumer(ChunkConsumer(req, self))
     141         return server.NOT_DONE_YET

   <packages>/buildbot/status/logfile.py:436 in subscribeConsumer
     435 def subscribeConsumer(self, consumer):
     436 assert not self._isNewStyle, "not available in new-style steps"
     437 p = LogFileProducer(self, consumer)
  exceptions.AssertionError: not available in new-style steps
 }}}

--

Comment:

 Thanks!  This is addressed in
   https://github.com/buildbot/buildbot/pull/1249

--
Ticket URL: <http://trac.buildbot.net/ticket/2930#comment:2>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the bugs mailing list