relation-get output is problematic
Marco Ceppi
marco at ondina.co
Wed May 9 20:43:45 UTC 2012
+1 for both implementations, it's been a bitter sweet victory to have
Booleans in Juju but no way to utilize a boolean type at its core. As
fas as charm breaks I used everyone's favorite depreciated command charm
getall and checked each charm, 16 of the 76 charms use 'True' in one
hook or another. Here's a quick snapshot of each charm, and the number
of times 'True' is mentioned
1 cloudfoundry-server
1 haproxy
1 mumble-server
2 hadoop-mapreduce
3 mysql
4 python-moinmoin
7 mediawiki
8 openerp-web
17 terracotta
18 buildbot-slave
27 hbase
31 buildbot-master
35 tomcat7
40 glance
48 hadoop
94 solr
Once a fix for this bug is put in place it should be easy enough to
update these charms to use the *correct* format.
Thanks,
Marco Ceppi
On Wed, 2012-05-09 at 13:09 -0700, Gustavo Niemeyer wrote:
> 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