def __init__(self, host_name: str) -> None: job_id = "%s-%s" % (self.job_prefix, host_name) last_job_status = WatoBackgroundJob(job_id).get_status() super(ServiceDiscoveryBackgroundJob, self).__init__( job_id, title=_("Service discovery"), stoppable=True, host_name=host_name, estimated_duration=last_job_status.get("duration"), )
def __init__(self, title=None): last_job_status = WatoBackgroundJob(self.job_prefix).get_status() super().__init__( self.job_prefix, title=title or self.gui_title(), lock_wato=True, stoppable=False, estimated_duration=last_job_status.get("duration"), ) if self.is_active(): raise MKGeneralException( _("Another renaming operation is currently in progress"))
def __init__(self, host_name: str) -> None: job_id = "%s-%s" % (self.job_prefix, host_name) last_job_status = WatoBackgroundJob(job_id).get_status() super().__init__( job_id, title=_("Service discovery"), stoppable=True, host_name=host_name, estimated_duration=last_job_status.get("duration"), ) self._pre_try_discovery = ( 0, TryDiscoveryResult( output="", check_table=[], host_labels={}, new_labels={}, vanished_labels={}, changed_labels={}, ), )