Skip to content

Commit

Permalink
Fixed db creation in oq run
Browse files Browse the repository at this point in the history
  • Loading branch information
micheles committed Sep 19, 2024
1 parent 814c61f commit 961febe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions openquake/commands/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ def main(job_ini,
user_name = getpass.getuser()

# automatically create the user db if missing
if config.dbserver.host == '127.0.0.1' and (
config.dbserver.file == '~/oqdata/db.sqlite3'):
if (config.dbserver.host == '127.0.0.1' and
config.dbserver.file == '~/oqdata/db.sqlite3'
and user_name != 'openquake'):
dbfile = os.path.expanduser(config.dbserver.file)
if not os.path.exists(dbfile):
db.actions.upgrade_db(dbapi.db)
Expand Down

0 comments on commit 961febe

Please sign in to comment.