From 362901ec28b26ba59ec7f6b7a135041532b1ec1a Mon Sep 17 00:00:00 2001 From: Matt Shin Date: Thu, 11 May 2017 11:45:49 +0100 Subject: [PATCH] scheduler, task_pool, task_proxy refactor Fixes following merge with #2276. --- lib/cylc/config.py | 3 --- lib/cylc/scheduler.py | 1 + lib/cylc/task_events_mgr.py | 3 +++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/cylc/config.py b/lib/cylc/config.py index 69f06832030..34412209e81 100644 --- a/lib/cylc/config.py +++ b/lib/cylc/config.py @@ -51,7 +51,6 @@ from parsec.OrderedDict import OrderedDictWithDefaults from parsec.util import replicate from cylc.suite_logging import OUT, ERR -from cylc.task_proxy import TaskProxy RE_SUITE_NAME_VAR = re.compile('\${?CYLC_SUITE_(REG_)?NAME}?') @@ -749,8 +748,6 @@ def __init__(self, suite, fpath, template_vars=None, '(graph the suite to see back-edges).') self.mem_log("config.py: end init config") - TaskProxy.suite_name = self.suite - TaskProxy.suite_url = self.cfg['URL'] def _expand_name_list(self, orig_names): """Expand any parameters in lists of names.""" diff --git a/lib/cylc/scheduler.py b/lib/cylc/scheduler.py index b14510ce776..af2240498c9 100644 --- a/lib/cylc/scheduler.py +++ b/lib/cylc/scheduler.py @@ -316,6 +316,7 @@ def configure(self): self.task_events_mgr.mail_interval = self._get_cylc_conf( "task event mail interval") self.task_events_mgr.mail_footer = self._get_events_conf("mail footer") + self.task_events_mgr.suite_url = self.config.cfg['URL'] if self.options.genref or self.options.reftest: self.configure_reftest() diff --git a/lib/cylc/task_events_mgr.py b/lib/cylc/task_events_mgr.py index 1d2b8e11698..27cfd36fe54 100644 --- a/lib/cylc/task_events_mgr.py +++ b/lib/cylc/task_events_mgr.py @@ -111,6 +111,7 @@ class TaskEventsManager(object): def __init__(self, suite, proc_pool, suite_db_mgr): self.suite = suite + self.suite_url = None self.proc_pool = proc_pool self.suite_db_mgr = suite_db_mgr self.mail_interval = 0.0 @@ -826,6 +827,8 @@ def _setup_custom_event_handlers(self, itask, event, message): "submit_num": itask.submit_num, "id": quote(itask.identity), "message": quote(message), + "task_url": quote(itask.tdef.rtconfig['URL']), + "suite_url": quote(self.suite_url), } if cmd == handler: # Nothing substituted, assume classic interface