def __init__(self, name, password, max_builds=None,
              notify_on_missing=[], missing_timeout=3600):
     """
     @param name: botname this machine will supply when it connects
     @param password: password this machine will supply when
                      it connects
     @param max_builds: maximum number of simultaneous builds that will
                        be run concurrently on this buildslave (the
                        default is None for no limit)
     """
     service.MultiService.__init__(self)
     self.slavename = name
     self.password = password
     self.botmaster = None # no buildmaster yet
     self.slave_status = SlaveStatus(name)
     self.slave = None # a RemoteReference to the Bot, when connected
     self.slave_commands = None
     self.slavebuilders = []
     self.max_builds = max_builds
     self.lastMessageReceived = 0
     if isinstance(notify_on_missing, str):
         notify_on_missing = [notify_on_missing]
     self.notify_on_missing = notify_on_missing
     for i in notify_on_missing:
         assert isinstance(i, str)
     self.missing_timeout = missing_timeout
     self.missing_timer = None
Exemple #2
0
    def __init__(self,
                 name,
                 password,
                 max_builds=None,
                 notify_on_missing=[],
                 missing_timeout=3600,
                 properties={},
                 locks=None,
                 keepalive_interval=3600):
        """
        @param name: botname this machine will supply when it connects
        @param password: password this machine will supply when
                         it connects
        @param max_builds: maximum number of simultaneous builds that will
                           be run concurrently on this buildslave (the
                           default is None for no limit)
        @param properties: properties that will be applied to builds run on
                           this slave
        @type properties: dictionary
        @param locks: A list of locks that must be acquired before this slave
                      can be used
        @type locks: dictionary
        """
        service.MultiService.__init__(self)
        self.slavename = name
        self.password = password
        self.botmaster = None  # no buildmaster yet
        self.slave_status = SlaveStatus(name)
        self.slave = None  # a RemoteReference to the Bot, when connected
        self.slave_commands = None
        self.slavebuilders = {}
        self.max_builds = max_builds
        self.access = []
        if locks:
            self.access = locks

        self.properties = Properties()
        self.properties.update(properties, "BuildSlave")
        self.properties.setProperty("slavename", name, "BuildSlave")

        self.lastMessageReceived = 0
        if isinstance(notify_on_missing, str):
            notify_on_missing = [notify_on_missing]
        self.notify_on_missing = notify_on_missing
        for i in notify_on_missing:
            assert isinstance(i, str)
        self.missing_timeout = missing_timeout
        self.missing_timer = None
        self.keepalive_interval = keepalive_interval

        self._old_builder_list = None