def addMasterSideWorker( self, connection_string=r"tcp:{port}:interface=127.0.0.1".format( port=DEFAULT_PORT), name="testworker", password="******", update_port=True, **kwargs): """ Create a master-side worker instance and add it to the BotMaster @param **kwargs: arguments to pass to the L{Worker} constructor. """ self.buildworker = worker.Worker(name, password, **kwargs) # reconfig the master to get it set up new_config = self.master.config new_config.protocols = {"pb": {"port": connection_string}} new_config.workers = [self.buildworker] new_config.builders = [ config.BuilderConfig(name='bldr', workername='testworker', factory=factory.BuildFactory()) ] yield self.botmaster.reconfigServiceWithBuildbotConfig(new_config) yield self.workers.reconfigServiceWithBuildbotConfig(new_config) if update_port: # as part of the reconfig, the worker registered with the # pbmanager, so get the port it was assigned self.port = self.buildworker.registration.getPBPort()
def _AddWorker(self, name): self.workers.append(worker.Worker(str(name), PASSWORDS[name]))