What sort of encoding does the websocket API expect for config-yaml?
John Meinel
john at arbash-meinel.com
Wed Mar 1 05:01:53 UTC 2017
Note my analysis could be incorrect. Anastasia has been digging into the
bug directly and is seeing 'nil' as a value get added to the content it the
database, and then get passed through to config-get. It appears that we
have a bug in that we have 2 code paths for taking charm defaults + charm
config and rending that into final config. The path used for 'juju config'
does the right thing, but 'config-get' does not. We're working to fix that
and have one path that handles this correctly.
Now, we might still need to switch from Config to ConfigYAML for users that
want to enter "" as a value (Config will treat that as "fall back to the
default" while ConfigYAML will set that as "use "" as the value".). But it
does appear that using Config is poking a real bug on the other side as
well.
John
=:->
On Wed, Mar 1, 2017 at 2:42 AM, Pete Vander Giessen <
pete.vandergiessen at canonical.com> wrote:
> Hi All,
>
> I'm currently working on getting python-libjuju to successfully deploy the
> landscape-dense-maas bundle. It fails, as outlined in
> https://bugs.launchpad.net/juju/+bug/1651260.
>
> (python-libjuju is a Python client that talks to Juju's websocket API; I'm
> currently using it inside the matrix testing framework.)
>
> The comments in that bug suggest that the root of the problem is that I'm
> trying to deploy a charm (haproxy) that has an empty string as a default
> value, but python-libjuju is using the legacy "config" param when it calls
> ApplicationDeploy in the api, rather than the new "config-yaml" param. This
> sounds simple to fix -- all I have to do is change an arg from "config" to
> "config-yaml", and everything should work!
>
> One hitch: the "config" param expects a json object, which is what we get
> back when we make our initial call to the planner, but config-yaml expects
> a string with yaml in it (this is per the logic in deployApplication in
> juju/apiserver/application/application.go).
>
> That also sounds simple. As we do elsewhere in python-libjuju when we want
> to pass a yaml blob to the API, I use Python's handy yaml library, do
> yaml.dump(config), where "config" is the json config object I got from the
> planner, and everything should work!
>
> This is where I'm stuck. If I pass in such a string, the websocket API
> simple hangs, and stops talking to me. I don't even see any error messages
> in the logs on my controller :-/
>
> Does anyone have any insight as to what I might be doing incorrectly? In
> Python3, yaml.dump will produce a utf-8 string by default. All of that will
> get serialized to json before being submitted over the websocket, though,
> so I don't *think* that it's an encoding issue. (Passing the bundle in as a
> yaml blob to the planner in the first place works.) The config object I get
> back from the planner isn't wrapped in an "options" key, but adding that
> key before dumping the config to a yaml string doesn't fix the problem -- I
> still see the hang.
>
> Apologies for the length of the post. And thanks in advance for anything
> you can do to get me unstuck!
>
> ~ PeteVG
>
> --
> Juju-dev mailing list
> Juju-dev at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/juju-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20170301/c4e883c7/attachment.html>
More information about the Juju-dev
mailing list