<div dir="ltr"><div>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.<br>
<br></div>cheers,<br>Kapil<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 31, 2013 at 7:14 PM, Andreas Hasenack <span dir="ltr"><<a href="mailto:andreas@canonical.com" target="_blank">andreas@canonical.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="im">On Fri, May 31, 2013 at 7:50 PM, Gustavo Niemeyer <span dir="ltr"><<a href="mailto:gustavo@niemeyer.net" target="_blank">gustavo@niemeyer.net</a>></span> wrote:<br>
</div><div class="gmail_extra"><div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Fri, May 31, 2013 at 6:46 PM, Andreas Hasenack <<a href="mailto:andreas@canonical.com" target="_blank">andreas@canonical.com</a>> wrote:<br>
> while playing with hooks I reached this bit in a config-changed hook:<br>
</div>(...)<br>
<div>> Why do I need to specify the unit id when I have the relation id already?<br>
<br>
</div>A single relation can have multiple units, and since you are in a<br>
config-changed context, there's no implicit hint about which remote<br>
unit you're talking about.<br>
<br></blockquote><div><br></div></div><div>But aren't the key-value pairs that I set in the relation the same for all units?</div></div></div></div>
<br>--<br>
Juju mailing list<br>
<a href="mailto:Juju@lists.ubuntu.com">Juju@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju</a><br>
<br></blockquote></div><br></div>