Mercurial > p > roundup > code
comparison roundup/admin.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 | 349a83aca61f |
| children | ca3e56590fcd |
comparison
equal
deleted
inserted
replaced
| 5040:f52a9fb035d2 | 5041:5251e97b1de0 |
|---|---|
| 419 print _('Error in configuration settings: "%s"') % args[3] | 419 print _('Error in configuration settings: "%s"') % args[3] |
| 420 raise | 420 raise |
| 421 else: | 421 else: |
| 422 defns = {} | 422 defns = {} |
| 423 | 423 |
| 424 defns['rdbms_backend'] = backend | |
| 424 # install! | 425 # install! |
| 425 init.install(tracker_home, templates[template]['path'], settings=defns) | 426 init.install(tracker_home, templates[template]['path'], settings=defns) |
| 426 init.write_select_db(tracker_home, backend) | |
| 427 | 427 |
| 428 print _(""" | 428 print _(""" |
| 429 --------------------------------------------------------------------------- | 429 --------------------------------------------------------------------------- |
| 430 You should now edit the tracker configuration file: | 430 You should now edit the tracker configuration file: |
| 431 %(config_file)s""") % {"config_file": config_ini_file} | 431 %(config_file)s""") % {"config_file": config_ini_file} |
| 500 If you re-initialise it, you will lose all the data! | 500 If you re-initialise it, you will lose all the data! |
| 501 Erase it? Y/N: """)) | 501 Erase it? Y/N: """)) |
| 502 if ok.strip().lower() != 'y': | 502 if ok.strip().lower() != 'y': |
| 503 return 0 | 503 return 0 |
| 504 | 504 |
| 505 backend = tracker.get_backend_name() | |
| 506 | |
| 507 # nuke it | 505 # nuke it |
| 508 tracker.nuke() | 506 tracker.nuke() |
| 509 | |
| 510 # re-write the backend select file | |
| 511 init.write_select_db(tracker_home, backend, tracker.config.DATABASE) | |
| 512 | 507 |
| 513 # GO | 508 # GO |
| 514 tracker.init(password.Password(adminpw, config=tracker.config)) | 509 tracker.init(password.Password(adminpw, config=tracker.config)) |
| 515 | 510 |
| 516 return 0 | 511 return 0 |
