Merge into trunk : assess-cloud-2 : Code : juju-ci-tools

Merge lp://staging/~abentley/juju-ci-tools/assess-cloud-2 into lp://staging/juju-ci-tools

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 1752
Proposed branch: lp://staging/~abentley/juju-ci-tools/assess-cloud-2
Merge into: lp://staging/juju-ci-tools
Prerequisite: lp://staging/~abentley/juju-ci-tools/assess-cloud
Diff against target: 395 lines (+199/-57)
4 files modified
To merge this branch: bzr merge lp://staging/~abentley/juju-ci-tools/assess-cloud-2
Reviewer Review Type Date Requested Status
Seman (community) Approve
Review via email: mp+311439@code.staging.launchpad.net

Commit message

Replace wait_for with condition-based version.

Description of the change

Replace wait_for with condition-based implementation.

EnvJujuClient.wait_for is rarely-used and quite limited. Which is a shame, because it's a great name.

This branch replaces the implementation with a more flexible one to be used assess-cloud, and intended to replace (or be used to implement) our existing family of wait_for methods.

This implementation accepts an iterable of conditions and then tests status against each of the conditions. If all the conditions are satisfied, it returns status.

Two examples are provided: WaitForSearch, which implements the original wait_for's test, and WaitMachineNotPresent, which is intended to be used with the remove-machine test in assess-cloud.

Status errors are handled via the new Status.raise_highest_error. If we time out with no status error, the first condition will have its do_raise method called.

Planned but not implemented yet:
- GroupReporter output
- Logging status text on exception.

To post a comment you must log in.
Revision history for this message
Seman (sseman) wrote :

Thank you.

review: Approve

Preview Diff

Failed to fetch available diffs.

[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