[Zope-Coders] Environment variables
Tres Seaver
tseaver@zope.com
29 Apr 2002 16:43:27 -0400
On Mon, 2002-04-29 at 15:09, Matt Behrens wrote:
> On Mon, Apr 29, 2002 at 01:21:30PM -0400, Tres Seaver wrote:
>
> > If we use ConfigParser (as Matt is working on), then each "section"
> > within the config file will correspond to a "namespace" for options;
> > using the namespaces from the environment or the command line might
> > be a bit tricky; perhaps we should marshal them using ':record'? :)
>
> Command-line is easy, if you do the "-o" example I posted some time
> back, i.e.
>
> zope start instance -o ZServer.HTTPPort=80 -o ZServer.ICPPort=1234
>
> etc. These would correspond to HTTPPort and ICPPort under the
> [ZServer] section, for example.
>
> Environment; I don't know how you'd do that. Is that an absolute
> must to support? I guess I can see how it'd be useful, but if it
> were me, I'd just backup and edit my instance.conf :-)
We have dueling requirments here:
- In steady state, system administrators want absolute
predictability; they don't need / want environment variables or
command-line options at all, *once the config file is correct*.
- Developers, and sysadmins who are working out the correct
configuration for their site, need to be able to restart the server
tweaking settings and testing. Environment variables and
command-line options address this problem.
We could add namespaces to environment variables, e.g.:
ENV_VAR="Namespace:Value"
Tres.
--
===============================================================
Tres Seaver tseaver@zope.com
Zope Corporation "Zope Dealers" http://www.zope.com