[users at bb.net] Accessing properties within an extract_fn

Elliot Saba staticfloat at gmail.com
Mon Jan 2 23:13:29 UTC 2017


Thanks Pierre,

I have worked around this in a different way, with a dummy
setPropertyFromCommand step (my workaround is here
<https://github.com/staticfloat/julia-buildbot/blob/level_up/master/package.py#L45-L77>)
that just runs `/bin/true`, but within the `command=` callback I manipulate
the properties as I desire.
-E

On Thu, Dec 29, 2016 at 6:15 AM, Pierre Tardy <tardyp at gmail.com> wrote:

> Hi Elliot,
>
> Looking at the source code, it is not possible to get the properties from
> extract_fn.
> https://github.com/buildbot/buildbot/blob/master/master/
> buildbot/steps/shell.py#L335
> However, you could easily override commandComplete in order to make your
> implementation.
>
>
> class mySetPropertyFromCommand(steps.SetPropertyFromCommand):
>     def commandComplete(self, cmd):
>         stdout = self.observer.getStdout()
>         stderr = self.observer.getStderr()
>         rc = cmd.rc
>         os = self.getProperty("os")
>         ...
>         self.setProperty("prop_name", "value", "mySetPropertyFromCommand")
>
>
> Le mer. 28 déc. 2016 à 20:09, Elliot Saba <staticfloat at gmail.com> a
> écrit :
>
>> Hi Pierre,
>>
>> I mean the function that gets called to parse out the results of a
>> setPropertyFromCommand call.
>>
>> On Wed, Dec 28, 2016, 04:14 Pierre Tardy <tardyp at gmail.com> wrote:
>>
>> Hi Elliot
>> What do you mean an extraction function?
>>
>> Le mer. 28 déc. 2016 12:16, Elliot Saba <staticfloat at gmail.com> a écrit :
>>
>> I want to access the properties of my build within a buildstep.  To do
>> so, I need to use something like `step.getProperty('foo')`, but I don't
>> know how to get the current step as a variable into my extraction
>> function.  Is there an easy way to get this information?  The reason I need
>> to do this is that I need to customize my extraction function based upon
>> the operating system of the worker my step is executing on.
>>
>> Thanks in advance,
>> -E
>>
>> _______________________________________________
>> users mailing list
>> users at buildbot.net
>> https://lists.buildbot.net/mailman/listinfo/users
>>
>> --
>>
>> -E
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/users/attachments/20170102/ec54a5ee/attachment.html>


More information about the users mailing list