|
16 | 16 | # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
17 | 17 | # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
18 | 18 | # |
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 $ |
20 | 20 |
|
21 | 21 | '''Administration commands for maintaining Roundup trackers. |
22 | 22 | ''' |
@@ -341,14 +341,21 @@ def help_initopts(self): |
341 | 341 | print _('Back ends:'), ', '.join(backends) |
342 | 342 |
|
343 | 343 | 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]]]]] |
345 | 345 | Install a new Roundup tracker. |
346 | 346 |
|
347 | 347 | The command will prompt for the tracker home directory |
348 | 348 | (if not supplied through TRACKER_HOME or the -i option). |
349 | 349 | The template, backend and admin password may be specified |
350 | 350 | on the command-line as arguments, in that order. |
351 | 351 |
|
| 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 | +
|
352 | 359 | The initialise command must be called after this command in order |
353 | 360 | to initialise the tracker's database. You may edit the tracker's |
354 | 361 | initial database contents before running that command by editing |
@@ -402,8 +409,18 @@ def do_install(self, tracker_home, args): |
402 | 409 | backend = 'anydbm' |
403 | 410 | # XXX perform a unit test based on the user's selections |
404 | 411 |
|
| 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 | + |
405 | 422 | # install! |
406 | | - init.install(tracker_home, templates[template]['path']) |
| 423 | + init.install(tracker_home, templates[template]['path'], settings=defns) |
407 | 424 | init.write_select_db(tracker_home, backend) |
408 | 425 |
|
409 | 426 | print _(""" |
|
0 commit comments