We need a relation identifier for hooks
Bug #791370 reported by
Gustavo Niemeyer
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pyjuju |
Confirmed
|
Medium
|
Unassigned |
Bug Description
There are several use cases which would benefit from having a unique identifier per relation. Today we can tell what are the service name, the relation name, and list all the units participating within the relation, but we can't determine an unique identifier for the given relation.
For the implementation, I suggest we use identifiers such as "relation-3", which is built upon the internal id for the given relation (relation-
This bug is related to bug #767195, except the latter is about iterating on the relations, while this one is simply about enabling the hook to know what's the relation it's executing for. As such, #767195 should be addressed afterwards.
Changed in ensemble: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
milestone: | none → dublin |
assignee: | nobody → Benjamin Saller (bcsaller) |
Changed in ensemble: | |
milestone: | dublin → eureka |
Changed in juju: | |
assignee: | Benjamin Saller (bcsaller) → nobody |
milestone: | eureka → florence |
To post a comment you must log in.
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.
"""