[Simple-cdd-devel] environment/config variable handling

Vagrant Cascadian vagrant at debian.org
Fri Feb 27 16:51:29 UTC 2015


On 2015-02-26, Enrico Zini <enrico at enricozini.org> wrote:
> On Sun, Feb 22, 2015 at 10:58:31AM -0800, Vagrant Cascadian wrote:
>
>> Just did a quick build and seems to work ok, minus the http_proxy issue.
>
> Try again now. I have added unit tests for variables that are not
> documented in the code but are taken from the environment, and should
> have fixed the http_proxy problem, although I do not have a setup where
> I can test it.

Updated and tested...

With http_proxy in the environment and in profiles/default.conf:

* wget uses http_proxy from environment
* reprepro uses http_proxy from default.conf

With http_proxy set only in profiles/default.conf:

* wget doesn't use http_proxy
* reprepro uses http_proxy from default.conf

with http_proxy only set in the envionment:

* wget uses http_proxy from environment
* reprepro uses http_proxy from environment

So, biggest problem this reveals is wget is ignoring
profiles/default.conf.

A smaller issue revealed is more of a question: should profiles/*.conf
should override environment variables? I need to verify how it works in
the original code to see if it's a change in behavior or not.


>> I hate the idea of pulling in a dependency that isn't yet in Debian, but
>> it seems like ConfigArgParse is designed to handle options set via
>> commandline, config file and environment variables:
>> 
>>   https://pypi.python.org/pypi/ConfigArgParse/0.9.3
>
> It could be packaged for Debian if needed, although the current
> Environment does not than just parse configuration, but it is also the
> working state for all functions, shell and python, exporting values to
> the environment and reimporting changes as needed. Since we do part of
> the work in shell, we currently need this way of passing working state
> back and forth.

Ok, was just something I ran across and wondered if it might be useful.


live well,
  vagrant
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/simple-cdd-devel/attachments/20150227/94259530/attachment.sig>


More information about the Simple-cdd-devel mailing list