Triggering relation events?

Nick Barcet nick.barcet at
Sun Dec 18 19:06:30 UTC 2011

On 12/18/2011 05:55 PM, Gustavo Niemeyer wrote:
>>> 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.

Thanks Gustavo. Glad to know it will be there sometime :)


More information about the Juju mailing list