[Buildbot-devel] How to check if build has property on buildbot 0.8.10?

Giovanni Gherdovich g.gherdovich at gmail.com
Mon Feb 9 15:12:15 UTC 2015


Hello,

I have this code on a builder that was running fine
in an old version of buildbot (0.8.1):

------------------------------------------------
factory = BuildFactory()
factory.addStep(ShellCommand(command=WithProperties("echo %(foo)s"),
                             doStepIf=lambda step:
step.build.getProperties().has_key('foo')))
------------------------------------------------

Now I upgraded to the latest version (buildbot 0.8.10, twisted 15.0.0)
and I get this error:

------------------------------------------------
Traceback (most recent call last):
Failure: twisted.internet.defer.FirstError: FirstError[#12, [Failure
instance: Traceback: <type 'exceptions.KeyError'>: 'foo'
/home/gghh/venv/sandbox/local/lib/python2.7/site-packages/Twisted-15.0.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py:1107:_inlineCallbacks
/home/gghh/venv/sandbox/local/lib/python2.7/site-packages/buildbot-0.8.10-py2.7.egg/buildbot/process/buildstep.py:312:startStep
/home/gghh/venv/sandbox/local/lib/python2.7/site-packages/buildbot-0.8.10-py2.7.egg/buildbot/process/properties.py:198:render
/home/gghh/venv/sandbox/local/lib/python2.7/site-packages/buildbot-0.8.10-py2.7.egg/buildbot/process/properties.py:157:render
--- <exception caught here> ---
/home/gghh/venv/sandbox/local/lib/python2.7/site-packages/Twisted-15.0.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py:140:maybeDeferred
/home/gghh/venv/sandbox/local/lib/python2.7/site-packages/buildbot-0.8.10-py2.7.egg/buildbot/process/properties.py:309:getRenderingFor
/home/gghh/venv/sandbox/local/lib/python2.7/site-packages/buildbot-0.8.10-py2.7.egg/buildbot/process/properties.py:266:__getitem__
/home/gghh/venv/sandbox/local/lib/python2.7/site-packages/buildbot-0.8.10-py2.7.egg/buildbot/process/properties.py:86:__getitem__
]]
------------------------------------------------

Over IRC I was suggested to change step.build.getProperties().has_key()
into step.build.hasProperty(), but it didn't help.

Any hint?

GGhh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20150209/d9b08ee6/attachment.html>


More information about the devel mailing list