[Buildbot-devel] buildstep factory

Andy Howell AndyHowell at austin.rr.com
Sun Jul 25 23:26:39 UTC 2010


On 07/24/2010 10:36 PM, Andy Howell wrote:
> Hello,
> 
> I'm trying to make a custom build step that has an extra attribute. I followed the example:
> 
> http://buildbot.net/buildbot/docs/0.8.1/Writing-BuildStep-Constructors.html#Writing-BuildStep-Constructors
> 
> My buildstep looks like:
> 
> class RaiPrepBuild(Compile):
>     """Prepare build, making packages and dependencies"""
> 
>     def __init__(self, make_extra=None, **kwargs):
>         Compile.__init__(self, **kwargs)
>         self.addFactoryArguments(make_extra=make_extra)
> 
>     def start(self):
>         """Override shell.Compile.start method."""
> 
>         if self.make_extra:
>             self.command.append("make_extra=%s" % self.make_extra)
> 
> When the build step is created however, I get an exception in the start() method:
> 
> exceptions.AttributeError: RaiPrepBuild instance has no attribute 'make_extra'
> 
> I can't figure out what this is. I trace through the code for process/base.py
> setupBuild(). The factory does have the "make_extra" argument, but the RaiPrepBuild does
> not have it when the step is built.
> 
> Any idea what I'm doing wrong?
> 

Sorry to reply to my own post. I got this working by adding self.make_extra=make_extra to
the __init__

def __init__(self, make_extra=None, **kwargs):
    Compile.__init__(self, **kwargs)
    self.make_extra=make_extra
    self.addFactoryArguments(make_extra=make_extra)

Regards,

	Andy




More information about the devel mailing list