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

Pierre Tardy tardyp at gmail.com
Mon Feb 9 15:20:31 UTC 2015


Did you try step.hasProperty() ?
or "prop" in step.getProperties() ?


Le Mon Feb 09 2015 at 4:15:09 PM, Giovanni Gherdovich <
g.gherdovich at gmail.com> a écrit :

> 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
> ------------------------------------------------------------
> ------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is
> your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20150209/4961b529/attachment.html>


More information about the devel mailing list