예제 #1
0
파일: pb.py 프로젝트: MPanH/buildbot
    def __init__(self, buildmaster_host, port, name, passwd, basedir,
                 keepalive, usePTY, keepaliveTimeout=None, umask=None,
                 maxdelay=300, numcpus=None, unicode_encoding=None,
                 allow_shutdown=None):

        # note: keepaliveTimeout is ignored, but preserved here for
        # backward-compatibility

        service.MultiService.__init__(self)
        BuildSlaveBase.__init__(
            self, name, basedir, usePTY, umask=umask, unicode_encoding=unicode_encoding)
        if keepalive == 0:
            keepalive = None

        self.numcpus = numcpus
        self.shutdown_loop = None

        if allow_shutdown == 'signal':
            if not hasattr(signal, 'SIGHUP'):
                raise ValueError("Can't install signal handler")
        elif allow_shutdown == 'file':
            self.shutdown_file = os.path.join(basedir, 'shutdown.stamp')
            self.shutdown_mtime = 0

        self.allow_shutdown = allow_shutdown
        bf = self.bf = BotFactory(buildmaster_host, port, keepalive, maxdelay)
        bf.startLogin(
            credentials.UsernamePassword(name, passwd), client=self.bot)
        self.connection = c = internet.TCPClient(buildmaster_host, port, bf)
        c.setServiceParent(self)
예제 #2
0
파일: pb.py 프로젝트: Ham22/buildbot
    def startService(self):
        BuildSlaveBase.startService(self)

        if self.allow_shutdown == 'signal':
            log.msg("Setting up SIGHUP handler to initiate shutdown")
            signal.signal(signal.SIGHUP, self._handleSIGHUP)
        elif self.allow_shutdown == 'file':
            log.msg("Watching %s's mtime to initiate shutdown" % self.shutdown_file)
            if os.path.exists(self.shutdown_file):
                self.shutdown_mtime = os.path.getmtime(self.shutdown_file)
            self.shutdown_loop = l = task.LoopingCall(self._checkShutdownFile)
            l.start(interval=10)
예제 #3
0
파일: pb.py 프로젝트: rajul/buildbot
    def startService(self):
        BuildSlaveBase.startService(self)

        if self.allow_shutdown == 'signal':
            log.msg("Setting up SIGHUP handler to initiate shutdown")
            signal.signal(signal.SIGHUP, self._handleSIGHUP)
        elif self.allow_shutdown == 'file':
            log.msg("Watching %s's mtime to initiate shutdown" %
                    self.shutdown_file)
            if os.path.exists(self.shutdown_file):
                self.shutdown_mtime = os.path.getmtime(self.shutdown_file)
            self.shutdown_loop = l = task.LoopingCall(self._checkShutdownFile)
            l.start(interval=10)
예제 #4
0
파일: pb.py 프로젝트: rajul/buildbot
    def __init__(self,
                 buildmaster_host,
                 port,
                 name,
                 passwd,
                 basedir,
                 keepalive,
                 usePTY,
                 keepaliveTimeout=None,
                 umask=None,
                 maxdelay=300,
                 numcpus=None,
                 unicode_encoding=None,
                 allow_shutdown=None):

        # note: keepaliveTimeout is ignored, but preserved here for
        # backward-compatibility

        service.MultiService.__init__(self)
        BuildSlaveBase.__init__(self,
                                name,
                                basedir,
                                usePTY,
                                umask=umask,
                                unicode_encoding=unicode_encoding)
        if keepalive == 0:
            keepalive = None

        self.numcpus = numcpus
        self.shutdown_loop = None

        if allow_shutdown == 'signal':
            if not hasattr(signal, 'SIGHUP'):
                raise ValueError("Can't install signal handler")
        elif allow_shutdown == 'file':
            self.shutdown_file = os.path.join(basedir, 'shutdown.stamp')
            self.shutdown_mtime = 0

        self.allow_shutdown = allow_shutdown
        bf = self.bf = BotFactory(buildmaster_host, port, keepalive, maxdelay)
        bf.startLogin(credentials.UsernamePassword(name, passwd),
                      client=self.bot)
        self.connection = c = internet.TCPClient(buildmaster_host, port, bf)
        c.setServiceParent(self)
예제 #5
0
파일: null.py 프로젝트: pombreda/buildbot-1
    def startService(self):
        # importing here to avoid dependency on buildbot master package
        from buildbot.buildslave.protocols.null import Connection

        yield BuildSlaveBase.startService(self)
        self.slavename = self.name
        conn = Connection(self.parent, self)
        res = yield self.parent.buildslaves.newConnection(conn, self.name)
        if res:
            yield self.parent.buildslaves.slaves[self.name].attached(conn)
예제 #6
0
    def startService(self):
        # importing here to avoid dependency on buildbot master package
        from buildbot.buildslave.protocols.null import Connection

        yield BuildSlaveBase.startService(self)
        self.slavename = self.name
        conn = Connection(self.parent, self)
        # I don't have a master property, but my parent has.
        master = self.parent.master
        res = yield master.buildslaves.newConnection(conn, self.name)
        if res:
            yield self.parent.attached(conn)
예제 #7
0
    def startService(self):
        # importing here to avoid dependency on buildbot master package
        from buildbot.buildslave.protocols.null import Connection

        yield BuildSlaveBase.startService(self)
        self.slavename = self.name
        conn = Connection(self.parent, self)
        # I don't have a master property, but my parent has.
        master = self.parent.master
        res = yield master.buildslaves.newConnection(conn, self.name)
        if res:
            yield self.parent.attached(conn)
예제 #8
0
파일: null.py 프로젝트: rajul/buildbot
    def startService(self):
        # importing here to avoid dependency on buildbot master package
        # requires buildot version >= 0.9.0b5
        from buildbot.worker.protocols.null import Connection

        yield BuildSlaveBase.startService(self)
        # TODO: This is a workaround for using worker with "slave"-api with
        # updated master.  Later buildbot-slave package will be replaced with
        # buildbot-worker package which will be "slave"-free, and this patch
        # will not be needed.
        self._workername = self.name
        conn = Connection(self.parent, self)
        # I don't have a master property, but my parent has.
        master = self.parent.master
        # TODO: This is a workaround for using worker with "slave"-api with
        # updated master.  Later buildbot-slave package will be replaced with
        # buildbot-worker package which will be "slave"-free, and this patch
        # will not be needed.
        res = yield master.workers.newConnection(conn, self.name)
        if res:
            yield self.parent.attached(conn)
예제 #9
0
파일: null.py 프로젝트: BeiNanWoo/buildbot
    def startService(self):
        # importing here to avoid dependency on buildbot master package
        # requires buildot version >= 0.9.0b5
        from buildbot.worker.protocols.null import Connection

        yield BuildSlaveBase.startService(self)
        # TODO: This is a workaround for using worker with "slave"-api with
        # updated master.  Later buildbot-slave package will be replaced with
        # buildbot-worker package which will be "slave"-free, and this patch
        # will not be needed.
        self._workername = self.name
        conn = Connection(self.parent, self)
        # I don't have a master property, but my parent has.
        master = self.parent.master
        # TODO: This is a workaround for using worker with "slave"-api with
        # updated master.  Later buildbot-slave package will be replaced with
        # buildbot-worker package which will be "slave"-free, and this patch
        # will not be needed.
        res = yield master.workers.newConnection(conn, self.name)
        if res:
            yield self.parent.attached(conn)