Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

#3620 closed defect (fixed)

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

Reported by: cpinto@… Owned by: Christian Boos
Priority: normal Milestone: 0.10
Component: admin/console Version: devel
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal 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 (3)

trac.ini_global (1.4 KB ) - added by cpinto@… 18 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@… 18 years ago.
the project's trac.ini after initenv
comment_out_globally_set_options-r3717.diff (2.5 KB ) - added by Christian Boos 18 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 (10)

by cpinto@…, 18 years ago

Attachment: trac.ini_global added

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

by cpinto@…, 18 years ago

Attachment: trac.ini_project added

the project's trac.ini after initenv

comment:1 by Matthew Good, 18 years ago

Keywords: needinfo added
Summary: trac-admin incorrectly creates a project's trac.ini settings based in global trac.ini settingssystem 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 by coderanger@…, 18 years ago

Why not add

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

at trac/env.py

comment:3 by anonymous, 18 years ago

er, make that if not ...

comment:6 by ilias@…, 18 years ago

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

Currently I have to manually delete the created entries.

by Christian Boos, 18 years ago

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

comment:7 by Christian Boos, 18 years ago

Keywords: review added; needinfo removed
Owner: changed from daniel to Christian Boos
Status: newassigned

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 by Christian Boos, 18 years ago

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

comment:9 by Christian Boos, 18 years ago

Keywords: review removed
Resolution: fixed
Status: assignedclosed

Above patch committed in r3744.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.