Merge lp:~lazypower/charm-helpers/add-workload-version into lp:charm-helpers
Proposed by
Charles Butler
Status: | Merged |
---|---|
Merged at revision: | 622 |
Proposed branch: | lp:~lazypower/charm-helpers/add-workload-version |
Merge into: | lp:charm-helpers |
Diff against target: |
40 lines (+19/-0) 2 files modified
charmhelpers/core/hookenv.py (+14/-0) tests/core/test_hookenv.py (+5/-0) |
To merge this branch: | bzr merge lp:~lazypower/charm-helpers/add-workload-version |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stuart Bishop (community) | Approve | ||
charmers | Pending | ||
Review via email: mp+305062@code.launchpad.net |
Description of the change
Adds:
- application-
- Test coverage to support the added code
To post a comment you must log in.
I'd rather see this do nothing than fail if it is called from 1.25. It currently raises a not implemented error, which will bite people maintaining charms that need to support old Juju. Unlike other tools like leader-set, I think this is more like status_set where it is better to just make do (in this case, do nothing). I'll let this approach through though, as it is somewhat a matter of opinion. But my personal opinion is I'd rather not have to guard all my calls in the PostgreSQL charm and have charm-helpers DWIM if it happens to be running with Juju 1.25.
I personally hate the @translate_exc approach, since it masks lots of other errors than 'not running a recent enough version of juju'. I much prefer "if has_juju_ version( '2.0')" , even though group think is that you should do it this way with all its caveats and hidden bugs rather than to concisely state that this is a Juju 2.0 feature. But I won't block review on this point since someone else has gone to the trouble of rewriting things using the less readable and more error prone approach :-/