Removing strict type-validation for string/int type configuration options (None is good!)

Charles Butler charles.butler at canonical.com
Mon Feb 10 14:54:59 UTC 2014


+1 to this. Null's or NoneType in configs will be a big help


On Mon, Feb 10, 2014 at 9:49 AM, Marco Ceppi <marco.ceppi at canonical.com>wrote:

> Hi all,
>
> Currently, one of the proof requirements within charm-tools is that all
> configuration options must have a default key with a matching type value
> for that key.
>
> Most notably, some charms omit the default key and use strict None/NULL
> checking within the charm.
>
> In order to statisfy this proof rule, which is currently a WARNING level
> (meaning it does not interrupt juju operation, but can affect tools within
> the ecosystem), we've taken to adding `default: ""` to these missing keys.
> The reason being we had no way previously to set a None/NULL type value via
> the command line.
>
> Given that we now have the ability to do so via `juju unset` I'd like to
> propose we drop the requirement of having strict type checking and allow
> None/NULL as a valid configuration default for both string and int types
> (but not bool). In doing so we will still require you have a default: key
> present but it set to an appropriate value of either a value of the type
> the configuration is OR None/NULL[0]
>
> A WARNING will still be raised if no default key is present or if the
> default key is not the type the configuration option expects (and in the
> case of string or int, also not NULL/None)
>
>  Looking for some +1's or feedback on this policy change, hoping to get
> it released in the next version of charm-tools.
>
> Thanks,
> Marco Ceppi
>
> [0]: http://yaml.org/type/null.html
>
> --
> Juju mailing list
> Juju at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20140210/f2384e5b/attachment.html>


More information about the Juju mailing list