One-way communication in relation-get (was Re: Juju feedback from the Launchpad Yellow Squad)
gary.poster at canonical.com
Wed Feb 15 19:43:43 UTC 2012
On 02/15/12 13:30, Graham Binns wrote:
> * The one-way communication aspect of relation-set was surprising (so I
> can relation-set foo=bar but I can never find out later on what I've
> already told a relation about config options).
> It would be great if there were a utility to retrieve whatever had
> been sent to a relation. This would also be a nice way of caching
> things for Charms :).
hazmat pointed out on IRC that this is possible now, and that
"relation-get -h" gives some direction on how. Putting "relation-get
-h" and https://juju.ubuntu.com/docs/charm.html#hook-environment
together, if you want to get the value for "mykey" that you set in a
relation, you can use "relation-get mykey $JUJU_UNIT_NAME".
hazmat continued, "it needs documentation, and it looks like it should
be a switch so a key doesn't need to be specified."
Sounds good to me.
More information about the Juju