Skip to content

Commit

Permalink
Merge pull request #108 from manics/db-check
Browse files Browse the repository at this point in the history
Don't check database if managedb not set
  • Loading branch information
joshmoore authored Jul 6, 2017
2 parents abdd852 + eafe00f commit 99744ec
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions omego/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,18 @@ def handle_database(self):
Handle database initialisation and upgrade, taking into account
command line arguments
"""
db = DbAdmin(self.dir, None, self.args, self.external)
status = db.check()
log.debug('OMERO database upgrade status: %s', status)

# TODO: When initdb and upgradedb are dropped we can just test
# managedb, but for backwards compatibility we need to support
# initdb without upgradedb and vice-versa

if self.args.initdb or self.args.upgradedb:
db = DbAdmin(self.dir, None, self.args, self.external)
status = db.check()
log.debug('OMERO database upgrade status: %s', status)
else:
log.warn('OMERO database check disabled')
return DB_INIT_NEEDED

if status == DB_INIT_NEEDED:
if self.args.initdb:
log.debug('Initialising OMERO database')
Expand Down

0 comments on commit 99744ec

Please sign in to comment.