From 984ecbab7bfa436166945f98ed5a1ab0c016d598 Mon Sep 17 00:00:00 2001 From: dcore94 Date: Thu, 8 Oct 2020 14:43:35 +0200 Subject: [PATCH] added support for domains --- config.cfg | 6 ++++-- pyexec.py | 10 ++++++++-- pyrest.py | 10 ++++++++-- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/config.cfg b/config.cfg index 6c5e342..3515b5d 100644 --- a/config.cfg +++ b/config.cfg @@ -1,11 +1,13 @@ [common] -server = http://conductorserver:8080/api +server = http://nubis2.int.d4science.net:8080/api +#domain = comma separated list of task domains to be applied to all task types as fallback [pyrest] threads = 3 pollrate = .1 +#domain = comma separated list of task domains to be applied to pyrest task type [pyexec] threads = 3 pollrate = .1 - +#domain = comma separated list of task domains to be applied to pyexec task type diff --git a/pyexec.py b/pyexec.py index 65fc813..7f07520 100644 --- a/pyexec.py +++ b/pyexec.py @@ -33,9 +33,15 @@ def main(): threads = cfg["pyexec"].getint("threads") pollrate = cfg["pyexec"].getfloat("pollrate") server = os.environ.get('CONDUCTOR_SERVER', cfg["common"]["server"]) - + + domain = cfg["pyexec"].get("domain") + if domain is None: + domain = cfg["common"].get("domain") + elif cfg["common"].get("domain") is not None: + domain = domain + "," + cfg["common"].get("domain") + cc = ConductorWorker(server, threads, pollrate, "pyexec") - cc.start('pyexec', pyexec, True) + cc.start('pyexec', pyexec, True, domain) if __name__ == '__main__': main() diff --git a/pyrest.py b/pyrest.py index 029fca4..6edc410 100644 --- a/pyrest.py +++ b/pyrest.py @@ -29,9 +29,15 @@ def main(): threads = cfg["pyrest"].getint("threads") pollrate = cfg["pyrest"].getfloat("pollrate") server = os.environ.get('CONDUCTOR_SERVER', cfg["common"]["server"]) - + + domain = cfg["pyrest"].get("domain") + if domain is None: + domain = cfg["common"].get("domain") + elif cfg["common"].get("domain") is not None: + domain = domain + "," + cfg["common"].get("domain") + cc = ConductorWorker(server, threads, pollrate, "pyrest") - cc.start('pyrest', pyrest, True) + cc.start('pyrest', pyrest, True, domain) if __name__ == '__main__': main()