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

Sebastian sebas5384 at gmail.com
Mon Feb 10 15:42:14 UTC 2014


Hi Marco,

It seems I would be needed that, so +1.

Cheers!,
Sebas.



2014-02-10 12:56 GMT-02:00 Matt Bruzek <matthew.bruzek at canonical.com>:

> Hi Marco,
>
> I have actually run in to this problem before you have my +1 for this!
>
> - Matt
>
>
> On Mon, Feb 10, 2014 at 8: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
>>
>>
>
>
> --
>    - Matt
>
> --
> 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/dc4711a5/attachment.html>


More information about the Juju mailing list