comparison roundup/init.py @ 5041:5251e97b1de0

Configure the database backend in the config.ini The database backend is currently configured in the 'db/backend_name' file which is just another file that needs to be configured when setting up or migrating a tracker instance. By moving this setting into the config.ini it helps to reduce the number of files that need to be configured and is more logical place for users to find the setting.
author John Kristensen <john@jerrykan.com>
date Mon, 22 Dec 2014 13:30:20 +1100
parents 3b632a25b1b3
children 198b6e810c67
comparison
equal deleted inserted replaced
5040:f52a9fb035d2 5041:5251e97b1de0
173 for name in 'name description intended-for path'.split(): 173 for name in 'name description intended-for path'.split():
174 f.write(writeHeader(name, info[name])) 174 f.write(writeHeader(name, info[name]))
175 finally: 175 finally:
176 f.close() 176 f.close()
177 177
178 def write_select_db(instance_home, backend, dbdir=None):
179 ''' Write the file that selects the backend for the tracker
180 '''
181 # dbdir is only supplied when AdminTool.do_initialise() invokes this
182 # function and the value is fetched from the tracker config which has
183 # already determined the correct path. This is bit of a hack, but it is
184 # likely this function will be removed in v1.6
185 if not dbdir:
186 dbdir = os.path.join(instance_home, 'db')
187 if not os.path.exists(dbdir):
188 os.makedirs(dbdir)
189 f = open(os.path.join(dbdir, 'backend_name'), 'w')
190 f.write(backend+'\n')
191 f.close()
192
193
194
195 # vim: set filetype=python sts=4 sw=4 et si : 178 # vim: set filetype=python sts=4 sw=4 et si :

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