diff roundup/backends/back_bsddb3.py @ 2736:402d6d556558

postgres backend open doesn't hide corruption in schema [SF#956375] *dbm-style backends nuke() method now clear id counters
author Richard Jones <richard@users.sourceforge.net>
date Fri, 08 Oct 2004 05:37:44 +0000
parents 11811b313459
children
line wrap: on
line diff
--- a/roundup/backends/back_bsddb3.py	Fri Oct 08 01:58:43 2004 +0000
+++ b/roundup/backends/back_bsddb3.py	Fri Oct 08 05:37:44 2004 +0000
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-#$Id: back_bsddb3.py,v 1.26 2004-07-27 01:59:28 richard Exp $
+#$Id: back_bsddb3.py,v 1.27 2004-10-08 05:37:44 richard Exp $
 '''This module defines a backend that saves the hyperdatabase in BSDDB3.
 '''
 __docformat__ = 'restructuredtext'
@@ -27,10 +27,10 @@
 from back_anydbm import Database, Class, FileClass, IssueClass
 
 def db_exists(config):
-    return os.path.exists(os.path.join(config.TRACKER_HOME, 'db', 'nodes.user'))
+    return os.path.exists(os.path.join(config.DATABASE, 'nodes.user'))
 
 def db_nuke(config):
-    shutil.rmtree(os.path.join(config.TRACKER_HOME, 'db'))
+    shutil.rmtree(config.DATABASE)
 
 #
 # Now the database
@@ -48,6 +48,8 @@
                 except os.error, error:
                     if error.errno != errno.ENOENT:
                         raise
+        # reset id sequences
+        os.remove(os.path.join(os.getcwd(), self.dir, '_ids'))
 
     def getclassdb(self, classname, mode='r'):
         ''' grab a connection to the class db that will be used for

Roundup Issue Tracker: http://roundup-tracker.org/