Finding out the service name from within a hook

Andreas Hasenack andreas at canonical.com
Mon Oct 20 12:00:36 UTC 2014


On Mon, Oct 20, 2014 at 9:55 AM, Christopher Glass <tribaal at gmail.com>
wrote:

> Y's unit name should be accessible through "$JUJU_REMOTE_UNIT" from
> X's relation-joined hook.
> See
> http://juju-docs.readthedocs.org/en/latest/internals/unit-agent-hooks.html
>

I tried that, but got in the weird situation where it's possible for a
relation to exist, but no units be part of it.

In other words, if relids = relation_ids(name) and relids is not null, it's
possible for relation_list(relids[0]) to be empty.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20141020/fddc5b5f/attachment.html>


More information about the Juju mailing list