Skip to content
Snippets Groups Projects
Commit 6fd83096 authored by Jeremy Auguste's avatar Jeremy Auguste
Browse files

Fix to use safe_load + Fix to work with besteffort jobs

parent 9f5cb47a
No related branches found
No related tags found
No related merge requests found
......@@ -95,7 +95,7 @@ def main():
args = argparser()
stats_output = subprocess.check_output(["oarstat", "--yaml"]).decode('utf-8')
stats_yaml = yaml.load(stats_output)
stats_yaml = yaml.safe_load(stats_output)
owners = {}
resources_pattern = re.compile('R=([0-9]+)')
......@@ -110,7 +110,10 @@ def main():
tokens = re.search(walltime_pattern, job_info["message"]).group(1).split(':')
wall_time = int(tokens[0]) * 3600 + int(tokens[1]) * 60 + int(tokens[2])
resources = int(re.search(resources_pattern, job_info["message"]).group(1))
try:
queue = re.search(queue_pattern, job_info["message"]).group(1)
except AttributeError:
queue = "besteffort"
try:
karma = float(re.search(karma_pattern, job_info["message"]).group(1))
except AttributeError:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment