def attached(self, bot): if not self._substantiation_notifier and self.build_wait_timeout >= 0: msg = 'Worker %s received connection while not trying to ' \ 'substantiate. Disconnecting.' % (self.name,) log.msg(msg) self._disconnect(bot) raise RuntimeError(msg) try: yield AbstractWorker.attached(self, bot) except Exception: self._substantiation_failed(failure.Failure()) return log.msg(r"Worker %s substantiated \o/" % (self.name,)) if not self._substantiation_notifier: log.msg("No substantiation deferred for %s" % (self.name,)) else: log.msg( "Firing %s substantiation deferred with success" % (self.name,)) self.substantiation_build = None self._substantiation_notifier.notify(True)
def attached(self, bot): if not self._substantiation_notifier and self.build_wait_timeout >= 0: msg = 'Worker %s received connection while not trying to ' \ 'substantiate. Disconnecting.' % (self.name,) log.msg(msg) self._disconnect(bot) raise RuntimeError(msg) try: yield AbstractWorker.attached(self, bot) except Exception: self._substantiation_failed(failure.Failure()) return log.msg(r"Worker %s substantiated \o/" % (self.name, )) if not self._substantiation_notifier: log.msg("No substantiation deferred for %s" % (self.name, )) else: log.msg("Firing %s substantiation deferred with success" % (self.name, )) self.substantiation_build = None self._substantiation_notifier.notify(True)
def attached(self, bot): if self.state != States.SUBSTANTIATING and \ self.build_wait_timeout >= 0: msg = 'Worker %s received connection while not trying to ' \ 'substantiate. Disconnecting.' % (self.name,) log.msg(msg) self._disconnect(bot) raise RuntimeError(msg) try: yield AbstractWorker.attached(self, bot) except Exception: self._substantiation_failed(failure.Failure()) return log.msg(r"Worker %s substantiated \o/" % (self.name, )) # only change state when we are actually substantiating. We could # end up at this point in different state than SUBSTANTIATING if # build_wait_timeout is negative. When build_wait_timeout is not # negative, we throw an error (see above) if self.state == States.SUBSTANTIATING: self.state = States.SUBSTANTIATED self._fireSubstantiationNotifier(True)