[Buildbot-devel] doStepIf function
clepple at gmail.com
Mon May 10 13:01:29 UTC 2010
On May 10, 2010, at 8:33 AM, robert dugal wrote:
> I cannot figure out the syntax for how to use doStepIf with a
> function so that the step is only executed if certain conditions are
> true. The condition needs to have some complex testing of builder
> properties so I want to write this as a function.
> How do I convert something like this below into using a function?
> (lambda(step): step.getProperty("FOO") in fooList)
> ), command='some command'))
Something like this:
return step.build.getProperties().has_key("FOO") and
step.getProperty("FOO") in fooList
doStepIf = do_step_test,
command = 'some command')
To make that work with lambda functions, I think you would need to put
the "and" inside a single lambda expression. The boolean "and" of two
function definitions won't get you what you want (not to be confused
with the *results* of two functions, "and"ed together).
More information about the devel