Merge lp://staging/~thedac/charm-helpers/amulet-juju2 into lp://staging/charm-helpers

Proposed by David Ames
Status: Merged
Merged at revision: 708
Proposed branch: lp://staging/~thedac/charm-helpers/amulet-juju2
Merge into: lp://staging/charm-helpers
Diff against target: 196 lines (+42/-84)
2 files modified
charmhelpers/contrib/amulet/utils.py (+11/-18)
tests/contrib/amulet/test_utils.py (+31/-66)
To merge this branch: bzr merge lp://staging/~thedac/charm-helpers/amulet-juju2
Reviewer Review Type Date Requested Status
Stuart Bishop (community) Approve
charmers Pending
Review via email: mp+318551@code.staging.launchpad.net

Description of the change

Fix Juju 2.x support for amulet utils

The command structure for juju actions changed dramatically from 1.x
to 2.x. Fix the handling for action to support both versions.

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) wrote :

juju_version and juju_has_version already exist in charmhelpers.core.hookenv

Revision history for this message
David Ames (thedac) wrote :

@Stuart,

True but they look at the version on the unit. For the amulet test we need to know the version of juju on the machine running the test.

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

Looks good to me, but I haven't landed as I'm unsure if someone else likes to own contrib.amulet

review: Approve
701. By David Ames

Make it explicit the support is for 2.1

Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :

FWIW, the action commands changed before 2.1. For reference, see this amulet commit from May 2016: https://github.com/juju/amulet/commit/78af62bf6e3dc502fe79e54576f54b277f038c7b

Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :

Actually it looks like it was this commit where action commands were updated for juju 2: https://github.com/juju/amulet/commit/7df4889590aa36783ce2c954465ccb8a501d8c97

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

I don't think there are any differences at all in the run-action and show-action-output commands between 2.0 and 2.1 (and if there were, we should open a bug and have the backward incompatible change reverted in 2.1.x).

review: Needs Fixing
Revision history for this message
Ryan Beisner (1chb1n) wrote :

The amulet test helpers in play here pre-date amulet's own action support. I'd be all for updating the tests to use the feature in amulet.

702. By David Ames

Translate to built in amulet action functions

703. By David Ames

Unit test Fixes

Update unit tests
Deprecate run_action()

Revision history for this message
David Ames (thedac) wrote :

@Stuart, @Tim, @Ryan,

This has been greatly simplified to just translate from the charmhelpers.contrib.amulet.utils versions to the amulet.actions versions of juju action commands.

This keeps us from having to touch 35+ charms to add Juju2 functionality and keeps the code in one place, amulet.actions.

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

Looks good to me. I haven't run the test suite yet, so haven't merged.

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