From c2296ea7dfaa8e90b3c64f006aaccfd9b28b7c41 Mon Sep 17 00:00:00 2001 From: Michele Simionato Date: Wed, 4 Oct 2023 10:41:15 +0200 Subject: [PATCH 1/2] Restored ds_calc_dir as it was --- openquake/commonlib/datastore.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openquake/commonlib/datastore.py b/openquake/commonlib/datastore.py index 9dc6d4894021..79c9a26e4cdd 100644 --- a/openquake/commonlib/datastore.py +++ b/openquake/commonlib/datastore.py @@ -82,7 +82,7 @@ def _read(calc_id: int, datadir, mode, haz_id=None): job = dbcmd('get_job', calc_id) if job: jid = job.id - path = job.ds_calc_dir + path = job.ds_calc_dir + '.hdf5' hc_id = job.hazard_calculation_id if not hc_id and haz_id: dbcmd('update_job', jid, {'hazard_calculation_id': haz_id}) @@ -90,7 +90,7 @@ def _read(calc_id: int, datadir, mode, haz_id=None): if hc_id and hc_id != jid: hc = dbcmd('get_job', hc_id) if hc: - ppath = hc.ds_calc_dir + ppath = hc.ds_calc_dir + '.hdf5' else: ppath = os.path.join(ddir, 'calc_%d.hdf5' % hc_id) else: # when using oq run there is no job in the db From 4a998189fb03a859d6042378eb512492dca88a5e Mon Sep 17 00:00:00 2001 From: Michele Simionato Date: Wed, 4 Oct 2023 10:43:12 +0200 Subject: [PATCH 2/2] Added forgotten change --- openquake/server/db/actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openquake/server/db/actions.py b/openquake/server/db/actions.py index c94e47fcb88a..61e045770078 100644 --- a/openquake/server/db/actions.py +++ b/openquake/server/db/actions.py @@ -116,7 +116,7 @@ def create_job(db, datadir, calculation_mode='to be set', job_id = db('INSERT INTO job (?S) VALUES (?X)', job.keys(), job.values() ).lastrowid db('UPDATE job SET ds_calc_dir=?x WHERE id=?x', - os.path.join(datadir, 'calc_%s.hdf5' % job_id), job_id) + os.path.join(datadir, 'calc_%s' % job_id), job_id) return job_id