Why is unit id mandatory in config-changed context?

Kapil Thangavelu kapil.thangavelu at canonical.com
Fri May 31 23:34:58 UTC 2013


relation-get retrieves values for one of n units. by default that's the
remote unit specified by the relation hook context that the relation hook
is executing for. As gustavo stated, when your in a config-changed hook,
there is no default remote related unit, hence the error. Only relation-set
operates only on the local unit, relation-get should always need
qualification in this context. Pyjuju can return an empty string here
instead of an error.

cheers,
Kapil


On Fri, May 31, 2013 at 7:14 PM, Andreas Hasenack <andreas at canonical.com>wrote:

> On Fri, May 31, 2013 at 7:50 PM, Gustavo Niemeyer <gustavo at niemeyer.net>wrote:
>
>> On Fri, May 31, 2013 at 6:46 PM, Andreas Hasenack <andreas at canonical.com>
>> wrote:
>> > while playing with hooks I reached this bit in a config-changed hook:
>> (...)
>> > Why do I need to specify the unit id when I have the relation id
>> already?
>>
>> A single relation can have multiple units, and since you are in a
>> config-changed context, there's no implicit hint about which remote
>> unit you're talking about.
>>
>>
> But aren't the key-value pairs that I set in the relation the same for all
> units?
>
> --
> Juju mailing list
> Juju at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20130531/9ae617e5/attachment.html>


More information about the Juju mailing list