diff roundup/init.py @ 4904:3b632a25b1b3

Correctly recreate the database directory during tracker re-initialise The database directory value was being fetched from the tracker config and being appended to the tracker home directory, but the database directory value in the config already has the tracker home prepended which resulted in the database directory being recreated in a nonsensical location. This fix is a bit of a hack, but the relevant code is likely to be removed in v1.6, so it shouldn't be too bad in the short term.
author John Kristensen <john@jerrykan.com>
date Sat, 12 Jul 2014 00:03:05 +1000
parents c86bc9646652
children 5251e97b1de0
line wrap: on
line diff
--- a/roundup/init.py	Fri Jul 04 15:43:22 2014 +0200
+++ b/roundup/init.py	Sat Jul 12 00:03:05 2014 +1000
@@ -175,12 +175,15 @@
     finally:
         f.close()
 
-def write_select_db(instance_home, backend, dbdir = 'db'):
+def write_select_db(instance_home, backend, dbdir=None):
     ''' Write the file that selects the backend for the tracker
     '''
-    # dbdir may be a relative pathname, os.path.join does the right
-    # thing when the second component of a join is an absolute path
-    dbdir = os.path.join (instance_home, dbdir)
+    # dbdir is only supplied when AdminTool.do_initialise() invokes this
+    # function and the value is fetched from the tracker config which has
+    # already determined the correct path. This is bit of a hack, but it is
+    # likely this function will be removed in v1.6
+    if not dbdir:
+        dbdir = os.path.join(instance_home, 'db')
     if not os.path.exists(dbdir):
         os.makedirs(dbdir)
     f = open(os.path.join(dbdir, 'backend_name'), 'w')

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