juju-core; default configuration value of ""

Stuart Bishop stuart.bishop at canonical.com
Fri Jun 21 18:38:38 UTC 2013


On Sat, Jun 22, 2013 at 12:56 AM, James Page <james.page at ubuntu.com> wrote:

> A couple of days ago I noticed a change in behaviour for default string
> configuration values of "" in juju-core when compared to pyjuju.
>
> Example config:
>
> options:
>   database:
>     default: ""
>     type: string
>     description: empty string
>   test_two:
>     type: string
>     description: no default string
>
> Under pyjuju:
>
> config-get --format=json database
> ""
> config-get --format=json test_two
> null
>
> Under juju-core:
>
> config-get --format=json database
> null
> config-get --format=json test_two
> null
>
> Specifically this breaks the postgresql charm on juju-core; I've raised a
> bug (see [0]) to which the juju-core team have responded; I prefer the
> proposed new behaviour (its in effect what I do in the charmn helpers I have
> written) but I appreciate that this will probably have impact on a large
> number of charms; so I'd like to throw this open to the list for further
> discussion.
>
> Thoughts?

(after reading bug comments too)

It would be possible to set null via the command line if relation-set
accepted json or yaml. We could even get real structured data in there
instead of all this v.split() rubbish and pickles being shuffled
around.

I suspect the charms that are complex enough to worry about null vs ''
are going to need updating for gojuju in any case.

If you are breaking compatibility, you might consider something like
"relation-set key=val -key2 key3=", where key2 ends up with null and
key3 ends up with the empty string. If '' and null are pretty much
interchangable with pyjuju it might not be as invasive as it looks.

-- 
Stuart Bishop <stuart.bishop at canonical.com>



More information about the Juju mailing list