relation-get output is problematic

Gustavo Niemeyer gustavo.niemeyer at canonical.com
Wed May 9 20:09:50 UTC 2012


Folks,

I've been talking to William about this issue, and this was already
discussed live with some of you.

We have an important bug to fix in relation-get and a few other
commands. Their output, somehow, ended up being *Python serialization*
rather than JSON or YAML, which is obviously wrong. It wasn't clear
that this was the case until very recently, when we introduced the
boolean types. That's made it obvious that this was the case because
one can see "True" (Python) instead of "true" (JSON/YAML) in the
output, but there are many other issues waiting to bite us seriously
(string formatting, for instance).

My proposal is this:

- Let's make the default output for everything structured be YAML
(e.g. relation-get -)
- Things like juju-log must not output *anything* (it is/was outputting {})

Then, I'd also like to take the chance to propose an extension to
relation-get to help people that are getting out of the

    if [ `relation-get some-bool` = True ]; then ...; fi

situation, that actually makes the charm interface depend on
Python-specific value names, onto a much better version:

    if relation-get --test some-bool; then ...; fi

If people are happy with that, this change should be done ASAP in
juju-python, and proposed as an SRU so that we can get the charms
fixed and get us a proper runway for 12.04+ onwards. I'm happy to help
automating things somehow, if necessary, to avoid some of the pain.

Comments?

-- 
Gustavo Niemeyer



More information about the Juju mailing list