[Buildbot-devel] reconfig, import and exec
Geoff Wedig
gwedig at d2.com
Fri May 11 23:25:15 UTC 2007
Robert Helmer wrote:
> Geoff Wedig wrote:
>> I am having a problem with reconfig which I am hoping someone might
>> give me some ideas how to fix.
>>
>> We have a lot of builds for various projects. To avoid having a huge
>> master.cfg, we have broken out portions (individual projects, slave
>> management, etc) into their own .py files. This makes the master.cfg
>> very simple:
>>
>> import slave_config
>>
>> import project1
>> import project2
>> .
>> .
>> .
>>
>> This works great when starting up the buildbot. It doesn't work so
>> well when doing reconfig. This is because, as far as I can tell, the
>> reconfig is being done using exec (see loadConfig in master.py).
>> This exec is executing the master (verified with print statements),
>> but is not re-importing any of the scripts (again, as far as I can
>> tell), but using the original versions. This means it doesn't see
>> any of the changes in those files.
>>
>> So, I can't imagine no one else has tried this, but I haven't found
>> anything in the docs to help figure out how to get around it. Can
>> anyone help?
>>
>
> This seems to work:
>
> import mozbuild
> reload(mozbuild)
>
> Where "mozbuild" has our specific code (e.g. subclasses of Steps).
>
> On the general point of splitting out the config files, I really like
> the idea. There's a feature request open to have buildbot support this
> directly:
> http://buildbot.net/trac/ticket/14
>
Yeah, that's what I needed. I'd hacked together something using a bunch
of exec commands which worked, but was really ugly to look at. This is
at least mostly clean.
Thanks.
--
Geoff Wedig
Software Engineer
Digital Domain
More information about the devel
mailing list