Skip to content

Commit bd90a61

Browse files
author
Alexander Smishlajev
committed
install: accept configuration setting overrides (based on patch [SF#237110])
1 parent 39311e9 commit bd90a61

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

roundup/admin.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: admin.py,v 1.96 2005-07-12 01:37:49 richard Exp $
19+
# $Id: admin.py,v 1.97 2005-12-03 11:26:08 a1s Exp $
2020

2121
'''Administration commands for maintaining Roundup trackers.
2222
'''
@@ -341,14 +341,21 @@ def help_initopts(self):
341341
print _('Back ends:'), ', '.join(backends)
342342

343343
def do_install(self, tracker_home, args):
344-
""'''Usage: install [template [backend [admin password]]]
344+
""'''Usage: install [template [backend [admin password [key=val[,key=val]]]]]
345345
Install a new Roundup tracker.
346346
347347
The command will prompt for the tracker home directory
348348
(if not supplied through TRACKER_HOME or the -i option).
349349
The template, backend and admin password may be specified
350350
on the command-line as arguments, in that order.
351351
352+
The last command line argument allows to pass initial values
353+
for config options. For example, passing
354+
"web_http_auth=no,rdbms_user=dinsdale" will override defaults
355+
for options http_auth in section [web] and user in section [rdbms].
356+
Please be careful to not use spaces in this argument! (Enclose
357+
whole argument in quotes if you need spaces in option value).
358+
352359
The initialise command must be called after this command in order
353360
to initialise the tracker's database. You may edit the tracker's
354361
initial database contents before running that command by editing
@@ -402,8 +409,18 @@ def do_install(self, tracker_home, args):
402409
backend = 'anydbm'
403410
# XXX perform a unit test based on the user's selections
404411

412+
# Process configuration file definitions
413+
if len(args) > 3:
414+
try:
415+
defns = dict([item.split("=") for item in args[3].split(",")])
416+
except:
417+
print _('Error in configuration settings: "%s"') % args[3]
418+
raise
419+
else:
420+
defns = {}
421+
405422
# install!
406-
init.install(tracker_home, templates[template]['path'])
423+
init.install(tracker_home, templates[template]['path'], settings=defns)
407424
init.write_select_db(tracker_home, backend)
408425

409426
print _("""

0 commit comments

Comments
 (0)