Juju GUI handling of empty config breaks promulgated charms

John Meinel john at arbash-meinel.com
Wed Feb 22 02:50:03 UTC 2017


We have a code snippet in deploy that says this:
    if len(args.ConfigYAML) > 0 {
        settings, err =
ch.Config().ParseSettingsYAML([]byte(args.ConfigYAML), args.ApplicationName)
    } else if len(args.Config) > 0 {
        // Parse config in a compatible way (see function comment).
        settings, err = parseSettingsCompatible(ch.Config(), args.Config)
    }
...
// parseSettingsCompatible parses setting strings in a way that is
// compatible with the behavior before this CL based on the issue
// http://pad.lv/1194945. Until then setting an option to an empty
// string caused it to reset to the default value. We now allow
// empty strings as actual values, but we want to preserve the API
// behavior.

So it appears that if you send the config as "ConfigYAML" instead of
"Config" then you don't get weird string behavior.


This apparently goes all the way back to Juju 1.15 (according to the bug):
https://bugs.launchpad.net/juju-core/+bug/1194945

Probably this is a case of "we added a new field which people *should* be
using, but didn't provide any actual push to force people to do so".

John
=:->


On Tue, Feb 21, 2017 at 10:19 PM, Pete Vander Giessen <
pete.vandergiessen at canonical.com> wrote:

> Hi All,
>
> There's a bug in core tracking this issue, here:
> https://bugs.launchpad.net/juju/+bug/1651260  You might want to leave
> some comments on the ticket, so people know that I'm not the only one
> running into it :-)
>
> (I believe that this affects the gui, matrix, and any other client that
> talks to the websocket api, rather than using the cli.)
>
> ~ PeteVG
>
> On Tue, Feb 21, 2017 at 8:27 AM Merlijn Sebrechts <
> merlijn.sebrechts at gmail.com> wrote:
>
>> Awesome, thanks!
>>
>> 2017-02-21 14:12 GMT+01:00 Stuart Bishop <stuart.bishop at canonical.com>:
>>
>> On 21 February 2017 at 16:44, Merlijn Sebrechts
>> <merlijn.sebrechts at gmail.com> wrote:
>> > PS: This bug was reported a few months ago by one of my colleagues, but
>> he
>> > didn't get a reply: https://bugs.launchpad.net/
>> cassandra-charm/+bug/1645821
>> >
>> > Is that the correct place to file bugs for the charm?
>>
>> Yes. I'm now correctly subscribed, so will see them in the future.
>>
>>
>> --
>> Stuart Bishop <stuart.bishop at canonical.com>
>>
>>
>> --
>> Juju mailing list
>> Juju at lists.ubuntu.com
>> Modify settings or unsubscribe at: https://lists.ubuntu.com/
>> mailman/listinfo/juju
>>
>
> --
> 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/20170222/5f93c6ce/attachment.html>


More information about the Juju mailing list