summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 111bcd4)
raw | patch | inline | side by side (parent: 111bcd4)
author | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 8 Mar 2010 15:12:42 +0000 (15:12 +0000) | ||
committer | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 8 Mar 2010 15:12:42 +0000 (15:12 +0000) |
- in instance when determining the backend
- during init after nuking the db it would create 'db'
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4472 57a73879-2fb5-44c3-a270-3262357dd7e2
- during init after nuking the db it would create 'db'
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4472 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/admin.py | patch | blob | history | |
roundup/init.py | patch | blob | history | |
roundup/instance.py | patch | blob | history |
diff --git a/roundup/admin.py b/roundup/admin.py
index 1b583e3196afa767ca89344abbc6a7e0733b28f3..511046df287691d90d12f80ac398ff1ff17cdbe3 100644 (file)
--- a/roundup/admin.py
+++ b/roundup/admin.py
tracker.nuke()
# re-write the backend select file
- init.write_select_db(tracker_home, backend)
+ init.write_select_db(tracker_home, backend, tracker.config.DATABASE)
# GO
tracker.init(password.Password(adminpw))
diff --git a/roundup/init.py b/roundup/init.py
index 7ecba91ef516ad7d261a828aa6e6dfd9f8dd374b..d4afecc9e8a50da5e33c7fc7d0dee6a3ff4e6918 100644 (file)
--- a/roundup/init.py
+++ b/roundup/init.py
finally:
f.close()
-def write_select_db(instance_home, backend):
+def write_select_db(instance_home, backend, dbdir = 'db'):
''' Write the file that selects the backend for the tracker
'''
- dbdir = os.path.join(instance_home, 'db')
+ # 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)
if not os.path.exists(dbdir):
os.makedirs(dbdir)
f = open(os.path.join(dbdir, 'backend_name'), 'w')
diff --git a/roundup/instance.py b/roundup/instance.py
index 53fe56bfab597adca7079cbce956320aed2367a4..6b0f09a3b767dc7fab70e42ed515d32625d12fef 100644 (file)
--- a/roundup/instance.py
+++ b/roundup/instance.py
def get_backend_name(self):
o = __builtins__['open']
- f = o(os.path.join(self.tracker_home, 'db', 'backend_name'))
+ f = o(os.path.join(self.config.DATABASE, 'backend_name'))
name = f.readline().strip()
f.close()
return name