incubator-bloodhound-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olemis Lang <ole...@gmail.com>
Subject Re: [Apache Bloodhound] #323: Add support for custom hooks configurable through trac.ini
Date Fri, 11 Jan 2013 20:27:59 GMT
On 1/11/13, Jure Zitnik <jure@digiverse.si> wrote:
>
[...]
>
> So I was playing with an idea to introduce global.ini (or boot.ini or
> something like that) that would be located on a well-known location in
> the installation tree (trac.env_parent_dir for example) and would hold
> global (=common for all environments) settings (custom hooks for
> starters). The question is where this configuration is supposed to be
> loaded/processed. trac/__init__.py would be one place but I'm not sure
> that's the right one :)
>

IMO there's no reason to spend some time developing something new for
this to happen . The reason is *not* that your reasoning is not
correct . The fact is that this (configuration inheritance) has been
already there since a long time . If you have one such file e.g.
global.ini and add the following lines in trac.ini

{{{
#!ini

[inherit]
file = /path/to/global.ini

}}}

then trac.ini will inherit all the settings specified in there .

So IMO , instead of modifying the source code to introduce such global
configuration files , I'd rather suggest to setup this at deployment
time e.g. in installer script .

PS: configuration inheritance even works for product environments ...
mainly in two (complementary) ways :

  1. if there's a value for [inherit] file option stored
      product config table (i.e. in the database) then
      it will work just like explained above for ini files .
      Relative paths are resolved relative to
      /path/to/env/conf sub-folder
  2. `parents` arg in multiproduct.config.Configuration.__init__

-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:

Mime
View raw message