Permalink
Browse files

Revert "Back up the Accounting DB only if it exists"

This reverts commit 29f80b0. This
commit was not needed because the Accounting DB is normally already
created.
  • Loading branch information...
1 parent 1f1008a commit 50185bf795206226714d7acee81722da7e2f26f9 @priteau priteau committed Oct 2, 2012
Showing with 9 additions and 6 deletions.
  1. +9 −6 home/libexec/nimbusconfigure.py
@@ -652,12 +652,15 @@ def copy_accounting_db(setup, old_db_path):
# The one we're about to replace
new_db_path = os.path.join(setup.gtdir, 'var/nimbus/WorkspaceAccountingDB')
- if os.path.isdir(new_db_path):
- # back this up, just in case this script is used in an odd way
- backup_db_path = os.path.join(setup.gtdir, 'var/nimbus/.prev-accountingDB')
- print "\nBacking up accounting DB to: %s ... " % backup_db_path
- shutil.move(new_db_path, backup_db_path)
- print " - Done."
+ if not os.path.isdir(new_db_path):
+ raise IncompatibleEnvironment("Could not find current Accounting DB: %s"
+ % new_db_path)
+
+ # back this up, just in case this script is used in an odd way
+ backup_db_path = os.path.join(setup.gtdir, 'var/nimbus/.prev-accountingDB')
+ print "\nBacking up accounting DB to: %s ... " % backup_db_path
+ shutil.move(new_db_path, backup_db_path)
+ print " - Done."
print "\nImporting accounting DB to: %s ... " % new_db_path
shutil.copytree(old_db_path, new_db_path)

0 comments on commit 50185bf

Please sign in to comment.