[Calypso] [PATCH] Allow to override calypso's config dir

Jelmer Vernooń≥ jelmer at jelmer.uk
Sun Jan 24 08:39:16 PST 2016


On Sun, Jan 24, 2016 at 12:37:46PM +0100, Petter Reinholdtsen wrote:
> Here is another patch from Guido, found via
> <URL: git://prometheus.amsuess.com/calypso-patches >.  He added this
> comment to it in 2014:
> 
>   This can be useful when running automatic tests via e.g. autopkgtest
>   where we want to have all files in a temporary directory.
> 
> diff --git a/calypso/config.py b/calypso/config.py
> index dc17eec..59cbd85 100644
> --- a/calypso/config.py
> +++ b/calypso/config.py
> @@ -72,6 +72,9 @@ for section, values in INITIAL_CONFIG.items():
>  
>  _CONFIG_PARSER.read("/etc/calypso/config")
>  _CONFIG_PARSER.read(os.path.expanduser("~/.config/calypso/config"))
> +cfg = os.getenv("CALYPSO_CONFIG")
> +if cfg:
> +    _CONFIG_PARSER.read(cfg)
>  
>  # Wrap config module into ConfigParser instance
>  sys.modules[__name__] = _CONFIG_PARSER

LGTM. Should this override the existing config, rather than adding to
it?

Jelmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://keithp.com/pipermail/calypso/attachments/20160124/55addd03/attachment.sig>


More information about the Calypso mailing list