Merge lp://qastaging/~hloeung/charm-helpers/add-principal-unit into lp://qastaging/charm-helpers
Proposed by
Haw Loeung
Status: | Merged |
---|---|
Merged at revision: | 773 |
Proposed branch: | lp://qastaging/~hloeung/charm-helpers/add-principal-unit |
Merge into: | lp://qastaging/charm-helpers |
Diff against target: |
53 lines (+36/-0) 1 file modified
charmhelpers/core/hookenv.py (+36/-0) |
To merge this branch: | bzr merge lp://qastaging/~hloeung/charm-helpers/add-principal-unit |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alex Kavanagh | Approve | ||
Stuart Bishop (community) | Approve | ||
Review via email: mp+328150@code.qastaging.launchpad.net |
Description of the change
Add support for principal unit
Juju 2.2 adds JUJU_PRINCIPAL_UNIT (LP# :1568161), for pre-2.2, we use the various charm's metadata.yaml to work that out.
To post a comment you must log in.
It would be nice if you can avoid the reltype argument. Its only used for the fallback code, and that will be removed sooner rather than later. Perhaps you can iterate over all the relations defined in the charm's metadata.yaml ?
metadata_unit() deserves a little more information in its docstring, pointing out that the unit needs to be co-located.
Ping me to land.