Skip to content

Commit 4d9e762

Browse files
authored
Merge pull request #9070 from gem/ds_calc_dir
Restored ds_calc_dir as it was
2 parents e7280d5 + 4a99818 commit 4d9e762

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

openquake/commonlib/datastore.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ def _read(calc_id: int, datadir, mode, haz_id=None):
8282
job = dbcmd('get_job', calc_id)
8383
if job:
8484
jid = job.id
85-
path = job.ds_calc_dir
85+
path = job.ds_calc_dir + '.hdf5'
8686
hc_id = job.hazard_calculation_id
8787
if not hc_id and haz_id:
8888
dbcmd('update_job', jid, {'hazard_calculation_id': haz_id})
8989
hc_id = haz_id
9090
if hc_id and hc_id != jid:
9191
hc = dbcmd('get_job', hc_id)
9292
if hc:
93-
ppath = hc.ds_calc_dir
93+
ppath = hc.ds_calc_dir + '.hdf5'
9494
else:
9595
ppath = os.path.join(ddir, 'calc_%d.hdf5' % hc_id)
9696
else: # when using oq run there is no job in the db

openquake/server/db/actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def create_job(db, datadir, calculation_mode='to be set',
116116
job_id = db('INSERT INTO job (?S) VALUES (?X)', job.keys(), job.values()
117117
).lastrowid
118118
db('UPDATE job SET ds_calc_dir=?x WHERE id=?x',
119-
os.path.join(datadir, 'calc_%s.hdf5' % job_id), job_id)
119+
os.path.join(datadir, 'calc_%s' % job_id), job_id)
120120
return job_id
121121

122122

0 commit comments

Comments
 (0)