Triggering relation events?

Gustavo Niemeyer gustavo.niemeyer at
Sun Dec 18 16:55:10 UTC 2011

>> One way to do that is to put that code in a config-changed hook which will
>> get called when you change the variables with juju set.

You're right Juan, this is the way this should be done indeed.
Whenever there are variables to be changed by the admin, the config
machinery is the way to go.

> This is only possible to do, AFAIK, in a relation environment where changing
> a relational parameter will trigger a relation-changed event on the other
> side.  When you are in a config-changed event, you not have access to
> relation-[set/get] since you do not have any context for a relation, nor can

And you're right Nick, this doesn't work yet, but this is a conscious
temporary shortcoming we've accepted, to get things going. The
relation-get/set commands will eventually be usable anywhere inside
the unit environment, even outside of any hooks. Of course, you'll
have to explicitly identify the relation being addressed, but the
underlying functionality will be supported.

Gustavo Niemeyer

-- I'm not absolutely sure of anything.

More information about the Juju mailing list