[Buildbot-devel] Any way to know if checkconfig is being run?

Richard O'Grady rjogrady at google.com
Tue Feb 11 19:57:42 UTC 2014


I just call this function:

def StartXYZServer():
  try:
    reactor.listenTCP(
        XYZServer.DEFAULT_PORT, pb.PBServerFactory(XYZServer()))
  except error.CannotListenError:
    # Probably buildbot is already running with this port open.
    # This happens e.g. during checkconfig as the config file is executed
    # with the server already running.
    pass

This PB server is unrelated to buildbot but it's convenient for us to have
it live and die with it.
I thought about looking in sys.argv but figured maybe there was a more
idiomatic way.
The idea of having a fake change source is neat, thanks.






On Tue, Feb 11, 2014 at 11:06 AM, John Carr <johnmdcarr at me.com> wrote:

> How are you starting the service? Do you have an example?
>
> It’s a bit yuck, but I think I implemented this sort of thing as a fake
> change source that wasn’t really a change source.  Then I added it to the
> normal list of change sources. That way I can raise config errors in my
> __init__, and buildbot only calls startService and stopService when its
> actually running.
>
> John
>
> On 11 Feb 2014, at 18:48, Richard O'Grady <rjogrady at google.com> wrote:
>
> > Hi,
> >
> > Is there an easy way to know if buildbot is executing the config file in
> checkconfig mode, versus start/restart?
> >
> > The reason I ask is that I am attaching a service to buildbot's reactor
> in our master.cfg which listens on a particular port. If buildbot is
> already running, this fails.
> > So I want to ignore the port-already-in-use exception if we're doing a
> checkconfig but raise the exception if it fails during a restart.
> >
> > Thanks!
> > // richard
> >
> >
> ------------------------------------------------------------------------------
> > Android apps run on BlackBerry 10
> > Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
> > Now with support for Jelly Bean, Bluetooth, Mapview and more.
> > Get your Android app in front of a whole new audience.  Start now.
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk_______________________________________________
> > 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/20140211/1b8a163f/attachment.html>


More information about the devel mailing list