[Zope-Coders] New API for Zope configuration info

Fred L. Drake, Jr. fred@zope.com
Tue, 11 Feb 2003 17:06:03 -0500


Andreas asked:
 > What about backward compatibility (for all exisiting env vars?).

and I responded:
 > We somewhat torn about how to deal with environment variables.  One
 > proposal has been to select the value of a field from the following
 > list of sources.  Sources earlier in the list override later sources:
 > 
 >   1. command line
 >   2. configuration file
 >   3. environment
 >   4. intrinsic default

Well, I indicated I wasn't sure I liked this arrangement.  I'm going
to propose that we use a different ordering instead:

  1. command line
  2. environment
  3. configuration file
  4. intrinsic default

I think this makes more sense, because it reflects both the difficulty
of changing values at each "layer", and the relative permanence of
each layer.

This also makes it easier to implement (lower risk), as I'll only need
to extend the option support in the zdaemon.zdoptions.ZDOptions class.

Part of the motivation for this is that the values that ZConfig
returns may have been provided by either a configuration file or the
configuration schema; introducing another layer at that point would
actually be more tedious than changes to ZDOptions to support
environment variables.


  -Fred

-- 
Fred L. Drake, Jr.  <fred at zope.com>
PythonLabs at Zope Corporation