[Zope-Coders] Environment variables

Jeffrey P Shell jeffrey@cuemedia.com
Mon, 29 Apr 2002 14:54:07 -0600


On 4/29/02 2:43 PM, "Tres Seaver" <tseaver@zope.com> wrote:

> 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.

Another requirement, that may have been mentioned already, is a clear
understanding of ALL of the configuration settings available.  This is a
nice feature in most of the existing unix .conf's, where all of the options
are in the file, but mostly commented out.

> We could add namespaces to environment variables, e.g.:
> 
> ENV_VAR="Namespace:Value"
> 
> Tres.

-- 
Jeffrey P Shell 
www.cuemedia.com