devtools: Fix cleanup of temporary database (closes #1908656) stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 06 Sep 2011 15:29:05 +0200
branchstable
changeset 7765 6f6253e44bdd
parent 7764 c709f6c457ff
child 7766 a832677c0aa6
devtools: Fix cleanup of temporary database (closes #1908656) The stored database path for clean up was not absolute. We now make the ``db-name`` absolute at database manade initialization. before storing the name for cleanup.
devtools/__init__.py
--- a/devtools/__init__.py	Tue Sep 06 15:16:06 2011 +0200
+++ b/devtools/__init__.py	Tue Sep 06 15:29:05 2011 +0200
@@ -672,8 +672,9 @@
         if 'global-db-name' not in self.system_source:
             self.system_source['global-db-name'] = self.system_source['db-name']
             process_db = self.system_source['db-name'] + str(os.getpid())
-            self.__TMPDB.add(process_db)
             self.system_source['db-name'] = process_db
+        process_db = self.absolute_dbfile() # update db-name to absolute path
+        self.__TMPDB.add(process_db)
 
     @staticmethod
     def _cleanup_database(dbfile):
@@ -694,7 +695,6 @@
         self.config.sources()['system']['db-name'] = dbfile
         return dbfile
 
-
     def process_cache_entry(self, directory, dbname, db_id, entry):
         return entry.get('sqlite')