relation-get - missing_unit behavior

Stuart Bishop stuart.bishop at canonical.com
Fri Jun 21 19:21:29 UTC 2013


Hi. This relates to https://bugs.launchpad.net/juju-core/+bug/1192803

For pathological and twisted reasons, I found the need to attempt to
retrieve a unit's relation data when that unit may not yet have joined
the relation. I know it *will* join, because it shares a peer
relation, but the relation-joined and relation-changed hooks can't
dictate the unit order or have any way of knowing which other units in
their service have already joined.

At the moment, relation-get on a unit that can't be found fails with
an error message and a fail return code.

I'm wondering if instead of the hard fail, that an empty result should
be received instead. This is somewhat consistent with other places
missing stuff is queried for, such as 'relation-get missing_key'
returns a null value. It also means if people doing odd things like me
will consistently get a result, rather than relation-get failing when
hooks are run in particular orders.


-- 
Stuart Bishop <stuart.bishop at canonical.com>



More information about the Juju mailing list