diff --git a/monitoring/db/scripts/get_detailed_power.py b/monitoring/db/scripts/get_detailed_power.py index 0a735e3..55a606e 100644 --- a/monitoring/db/scripts/get_detailed_power.py +++ b/monitoring/db/scripts/get_detailed_power.py @@ -57,7 +57,9 @@ class Power: @classmethod def from_db(cls, db, jobid, interval): all_list = db.db_to_list(jobid, interval) - + if not all_list: + raise RuntimeError + return Power.from_list(all_list) @@ -190,7 +192,12 @@ class App: def run_all(self): for jobid in self.config.jobid: - power = Power.from_db(self.db, jobid, self.config.interval) + try: + power = Power.from_db(self.db, jobid, self.config.interval) + except RuntimeError: + print('No data found for job ID "{}"'.format(jobid)) + continue + fn = power.to_file(jobid) if fn: print('Created file {fn}'.format(fn=fn))