def __init__(self, name, scheduler, queueing=True, all_nodes=False, node_pool=None, enabled=True, action_graph=None, run_collection=None, parent_context=None, output_path=None, allow_overlap=None, action_runner=None, max_runtime=None): super(Job, self).__init__() self.name = name self.action_graph = action_graph self.scheduler = scheduler self.runs = run_collection self.queueing = queueing self.all_nodes = all_nodes self.enabled = enabled self.node_pool = node_pool self.allow_overlap = allow_overlap self.action_runner = action_runner self.max_runtime = max_runtime self.output_path = output_path or filehandler.OutputPath() self.output_path.append(name) self.event = event.get_recorder(self.name) self.context = command_context.build_context(self, parent_context) self.event.ok('created')
def __init__(self, job_name, run_num, run_time, node, output_path=None, base_context=None, action_runs=None, action_graph=None, manual=None): super(JobRun, self).__init__() self.job_name = job_name self.run_num = run_num self.run_time = run_time self.node = node self.output_path = output_path or filehandler.OutputPath() self.output_path.append(self.id) self.action_runs_proxy = None self._action_runs = None self.action_graph = action_graph self.manual = manual self.event = event.get_recorder(self.full_id) self.event.ok('created') if action_runs: self.action_runs = action_runs self.context = command_context.build_context(self, base_context)
def __init__(self, name, scheduler, queueing=True, all_nodes=False, node_pool=None, enabled=True, action_graph=None, run_collection=None, parent_context=None, output_path=None, allow_overlap=None, action_runner=None, max_runtime=None, email_name=None, email=None, command=None, priority=None, owner=None, impact=None, expected_runtime=None, num_retries=None): super(Job, self).__init__() self.name = name self.email_name = name.split(".")[1].replace('_', ' ') self.email = email self.command = command self.priority = priority self.owner = owner self.impact = impact self.action_graph = action_graph self.scheduler = scheduler self.runs = run_collection self.queueing = queueing self.all_nodes = all_nodes self.enabled = enabled self.node_pool = node_pool self.allow_overlap = allow_overlap self.action_runner = action_runner self.max_runtime = max_runtime self.expected_runtime = expected_runtime self.num_retries = num_retries self.output_path = output_path or filehandler.OutputPath() self.output_path.append(name) self.event = event.get_recorder(self.name) self.context = command_context.build_context(self, parent_context) self.event.ok('created')
def __init__(self, name, scheduler, queueing=True, all_nodes=False, owner='', summary='', notes='', node_pool=None, enabled=True, action_graph=None, run_collection=None, parent_context=None, output_path=None, allow_overlap=None, action_runner=None, max_runtime=None): super(Job, self).__init__() self.name = name self.owner = owner self.summary = summary self.notes = notes self.action_graph = action_graph self.scheduler = scheduler self.runs = run_collection self.queueing = queueing self.all_nodes = all_nodes self.enabled = enabled self.node_pool = node_pool self.allow_overlap = allow_overlap self.action_runner = action_runner self.max_runtime = max_runtime self.output_path = output_path or filehandler.OutputPath() self.output_path.append(name) self.event = event.get_recorder(self.name) self.context = command_context.build_context(self, parent_context) self.event.ok('created')
def __init__(self, config, instance_collection): super(Service, self).__init__() self.config = config self.instances = instance_collection self.enabled = False args = config.restart_delay, self.repair self.repair_callback = eventloop.UniqueCallback(*args) self.event_recorder = event.get_recorder(str(self))
def test_render_GET(self): recorder = event.get_recorder(self.name) ok_message, critical_message ='ok message', 'critical message' recorder.ok(ok_message) recorder.critical(critical_message) response = self.resource.render_GET(self.request()) names = [e['name'] for e in response['data']] assert_equal(names, [ok_message, critical_message])
def test_render_GET(self): recorder = event.get_recorder(self.name) ok_message, critical_message = 'ok message', 'critical message' recorder.ok(ok_message) recorder.critical(critical_message) response = self.resource.render_GET(self.request()) names = [e['name'] for e in response['data']] assert_equal(names, [critical_message, ok_message])
def __init__(self, working_dir, config_path): super(MasterControlProgram, self).__init__() self.jobs = job.JobCollection() self.services = service.ServiceCollection() self.working_dir = working_dir self.crash_reporter = None self.config = manager.ConfigManager(config_path) self.context = command_context.CommandContext() self.event_recorder = event.get_recorder() self.event_recorder.ok('started') self.state_watcher = statemanager.StateChangeWatcher()
def __init__(self, job_name, run_num, run_time, node, output_path=None, base_context=None, action_runs=None, action_graph=None, manual=None): super(JobRun, self).__init__() self.job_name = job_name self.run_num = run_num self.run_time = run_time self.node = node self.output_path = output_path or filehandler.OutputPath() self.output_path.append(self.id) self.action_runs_proxy = None self._action_runs = None self.action_graph = action_graph self.manual = manual self.event = event.get_recorder(self.id) self.event.ok('created') if action_runs: self.action_runs = action_runs self.context = command_context.build_context(self, base_context)
def render_GET(self, request): recorder = event.get_recorder(self.entity_name) response_data = adapter.adapt_many(adapter.EventAdapter, recorder.list()) return respond(request, dict(data=response_data))
def __init__(self, emailer): self.emailer = emailer self.event_recorder = event.get_recorder(str(self))