Skip to content
Snippets Groups Projects
Commit 9da6929e authored by Fabrizio Chiarello's avatar Fabrizio Chiarello
Browse files

Merge branch 'fix_regression'


* fix_regression:
  Fix regression on job argument parsing

Signed-off-by: default avatarFabrizio Chiarello <fabrizio.chiarello@pd.infn.it>
parents f5a8dfdd df2437da
No related branches found
Tags v0.1.0
No related merge requests found
......@@ -5,7 +5,7 @@
#
# caos-collector - CAOS collector
#
# Copyright © 2017 INFN - Istituto Nazionale di Fisica Nucleare (Italy)
# Copyright © 2017, 2018 INFN - Istituto Nazionale di Fisica Nucleare (Italy)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -50,6 +50,9 @@ class Job(object):
raise NotImplementedError
def run_job(self, args):
self.logger.info("Running job {name} with arguments: {args}"
.format(name=self.name(), args=args))
self._check_connectivity()
ok = tsdb.refresh_token()
......
......@@ -99,13 +99,19 @@ def get_job_instance(name):
return job_class()
def job_run_partial(job_instance, cmdline):
parser = build_parser()
args = parser.parse_args(shlex.split(cmdline))
job_instance.run_job(args)
def job_partial(cmdline):
parser = build_parser()
args = parser.parse_args(shlex.split(cmdline))
job_name = args.job
job_instance = get_job_instance(job_name)
func = partial(job_instance.run_job, args)
func = partial(job_run_partial, job_instance, cmdline)
return (func, job_name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment