Edgewall Software
Modify

Ticket #3620 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

system defaults in new trac.ini override global trac.ini

Reported by: cpinto@… Owned by: cboos
Priority: normal Milestone: 0.10
Component: admin/console Version: devel
Severity: normal Keywords:
Cc:
Release Notes:
API Changes:

Description

I have defined a set of standard settings in a global trac.ini file and after doing a trac-admin initenv for a new project I noticed that the trac.ini settings for the project did contain keys defined in the global file with different values.

Attachments

trac.ini_global (1.4 KB) - added by cpinto@… 5 years ago.
the global trac.ini file (I've appended a _global suffix so that the file isn't overridden)
trac.ini_project (1.2 KB) - added by cpinto@… 5 years ago.
the project's trac.ini after initenv
comment_out_globally_set_options-r3717.diff (2.5 KB) - added by cboos 5 years ago.
Possible fix for the issue: special case the None value to be an indicator of a globally set configuration option.

Download all attachments as: .zip

Change History

Changed 5 years ago by cpinto@…

the global trac.ini file (I've appended a _global suffix so that the file isn't overridden)

Changed 5 years ago by cpinto@…

the project's trac.ini after initenv

comment:1 Changed 5 years ago by mgood

  • Keywords needinfo added
  • Summary changed from trac-admin incorrectly creates a project's trac.ini settings based in global trac.ini settings to system defaults in new trac.ini override global trac.ini

What are you expecting the behavior to be? trac-admin always initializes trac.ini with the standard Trac default values. I guess you were expecting that the new trac.ini would either copy the values from the global config, or omit them so they didn't override the global config.

comment:2 Changed 5 years ago by coderanger@…

Why not add

if self.config.site_config.has_option(section, name):

at trac/env.py

comment:3 Changed 5 years ago by anonymous

er, make that if not ...

comment:6 Changed 5 years ago by ilias@…

I would suggest to ommit the values which exist in the global.ini.

Currently I have to manually delete the created entries.

Changed 5 years ago by cboos

Possible fix for the issue: special case the None value to be an indicator of a globally set configuration option.

comment:7 Changed 5 years ago by cboos

  • Keywords review added; needinfo removed
  • Owner changed from daniel to cboos
  • Status changed from new to assigned

An other possibility: attachment:comment_out_globally_set_options-r3717.diff

With this solution, the entry will be written, but commented out, indicating that the actual value is taken from the global trac.ini file.
This solution makes it easy to:

  • fill in a different the value to override the globally configured one
  • automatically take into account changes in the global trac.ini

comment:8 Changed 5 years ago by cboos

Any comment on the patch? Otherwise, I'll proceed and commit it later today.

comment:9 Changed 5 years ago by cboos

  • Keywords review removed
  • Resolution set to fixed
  • Status changed from assigned to closed

Above patch committed in r3744.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from cboos. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.