[Buildbot-devel] getting buildslaves to exit after one build?

Tom Prince tom.prince at ualberta.net
Tue Aug 28 05:01:58 UTC 2012


Dan Kegel <dank at kegel.com> writes:

> More completely:
>
> diff --git a/master/buildbot/process/build.py b/master/buildbot/process/build.py
> index 3477444..9af4f67 100644
> --- a/master/buildbot/process/build.py
> +++ b/master/buildbot/process/build.py
> @@ -246,6 +246,9 @@ class Build(properties.PropertiesMixin):
>          def _release_slave(res, slave, bs):
>              self.slavebuilder.buildFinished()
>              slave.updateSlaveStatus(buildFinished=bs)
> +            if (slave.properties.getProperty('oneshot', False)):
> +                log.msg("Shutting down oneshot slave!")
> +                slave.shutdown()
>              return res
>          d.addCallback(_release_slave, self.slavebuilder.slave, build_status)

Well, if that is all you need to shutdown the instance, then
    def stop_instance(self, fast=False):
        self.shutdown()
would seem to do what you need (in a latent slave).

  Tom




More information about the devel mailing list