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
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.
Revision history for this message
Stuart Bishop (stub) wrote :

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.

review: Approve
Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

The needs fixing is around proper docstring comments about what the functions take and return. I'm abstain (but please read the comment) on code organisation, function naming and scope of the functions.

review: Needs Fixing
Revision history for this message
Haw Loeung (hloeung) :
Revision history for this message
Stuart Bishop (stub) :
review: Approve
Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

As it's still work in progress I'll hold off updating my review for the moment. Thanks for looking into this again @hloeung

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

It's been merged, but I am now an approve on the latest changes.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches