Skip to content

Commit

Permalink
[Migration] Fix seq_no_db moving
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Nikitin <[email protected]>
  • Loading branch information
Andrew Nikitin committed Jun 27, 2018
1 parent 2b7bde9 commit b72907c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions data/migrations/deb/1_3_428_to_1_3_429.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,13 @@ def rename_seq_no_db(db_dir):
old_seqno_path = os.path.join(db_dir, config.seqNoDbName)
new_seqno_db_name = config.seqNoDbName + '_new'
new_seqno_path = os.path.join(db_dir, new_seqno_db_name)
try:
shutil.rmtree(old_seqno_path)
except Exception:
logger.error(traceback.print_exc())
logger.error("Could not remove old seq_no_db: {}"
.format(old_seqno_path))
return False
try:
shutil.move(new_seqno_path, old_seqno_path)
except Exception:
Expand Down

0 comments on commit b72907c

Please sign in to comment.