Code review comment for lp://qastaging/~lazypower/charm-helpers/add-workload-version

Revision history for this message
Stuart Bishop (stub) wrote :

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 :-/

review: Approve

« Back to merge proposal