Comment 2 for bug 791370

Revision history for this message
Kapil Thangavelu (hazmat) wrote : Re: [Bug 791370] Re: We need a relation identifier for hooks

Excerpts from Gustavo Niemeyer's message of Mon Jun 13 20:17:29 UTC 2011:
> Clint has another use case for this, described in bug #791042:
>
> """
> While working on the mysql formula, I needed a way to record the fact that a relation had been broken, so that when it was re-added, the code path would be slightly different since the database already existed.
>
> Unfortunately, the environment doesn't seem to contain an indicator as
> to which relationship is broken. ENSEMBLE_RELATION only tells me which
> of my relations are being broken, but not what remote service has been
> unrelated.
>
> The workaround is to run 'relation-list' which seems to somehow know which relationship is being broken and only return the members of it. Whatever it uses to know that, should be exposed to the hook in the environment.
> """
>

When the relation is re-added it would be a new relation, so its not clear that relation identifiers will help in that case.