[Buildbot-devel] using **kwargs with MasterShellCommand

Jürgen Schulz-Brüssel juergen.schulz-bruessel at thinkproject.com
Wed May 16 15:05:22 UTC 2012


Hi,

I am using Buildbot 0.8.6p1 with Twisted 12.0.0. I have a problem in 
using **kwargs with the MasterShellCommand.

I am trying the following:

class NewClass(MasterShellCommand):

     def __init__(self, **kwargs):
       self.arg1 = kwargs.get('arg1')
       self.arg2 = kwargs.get('arg2')
       print self.arg1
       print self.arg2
       MasterShellCommand.__init__(self, "")

     def start(self):
       self.command=[self.arg1 + 'somestring',
                           WithProperties("build-%s.tar.gz", "revision"),
                           self.arg2]
       return MasterShellCommand.start(self)

     def finished(self, result):
         ...

it is called

NewClass(arg1='path', arg2='string')

Everything is just fine when I am running

buildbot checkconfig
The print statements deliver the expected outputs. When I am running the 
buildstep the logfile shows

exceptions.TypeError: unsupported operand type(s) for +: 'NoneType' and 
'str'

So for some reason self.arg1 and self.arg2 are a None object while I am 
awaiting a string. Can anybody pleas help me with this?
Additionally there is an unexpected problem using WithProperties. If I 
am using the shown command an exception is thrown:

File "/usr/lib/python2.6/site-packages/buildbot-0.8.6p1-py2.6.egg/buildbot/process/buildstep.py", line 551, in _startStep_3
     if self.start() == SKIPPED:
   File "/think/buildbot/master/master.cfg", line 158, in start
     return MasterShellCommand.start(self)
   File "/usr/lib/python2.6/site-packages/buildbot-0.8.6p1-py2.6.egg/buildbot/steps/master.py", line 99, in start
     stdio_log.addHeader(" ".join(command) + "\n\n")
exceptions.TypeError: sequence item 5: expected string, instance found

This occurs only if I am using theWithProperties as shown above.

Best
Juergen






More information about the devel mailing list