Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise missing parser exception as warning and not as error #187

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions slurm_state/mongo_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Insert elements extracted from the Slurm reports into the database.
"""

import copy, json, os, time
import copy, json, logging, os, time
from pymongo import InsertOne, ReplaceOne, UpdateOne


Expand Down Expand Up @@ -35,9 +35,12 @@ def fetch_slurm_report(parser, report_path):
assert ctx is not None, f"{cluster_name} not configured"

with open(report_path, "r") as f:
for e in parser.parser(f):
e["cluster_name"] = cluster_name
yield e
try:
for e in parser.parser(f):
e["cluster_name"] = cluster_name
yield e
except Exception as e:
logging.warning(str(e))


def slurm_job_to_clockwork_job(slurm_job: dict):
Expand Down
Loading