Merge lp:~jimbaker/juju-jitsu/watch-failfast into lp:juju-jitsu
Status: | Merged |
---|---|
Approved by: | Mark Mims |
Approved revision: | 75 |
Merge reported by: | Mark Mims |
Merged at revision: | not available |
Proposed branch: | lp:~jimbaker/juju-jitsu/watch-failfast |
Merge into: | lp:juju-jitsu |
Prerequisite: | lp:~jimbaker/juju-jitsu/provider-info |
Diff against target: |
358 lines (+167/-146) 2 files modified
sub-commands/aiki/cli.py (+15/-0) sub-commands/watch (+152/-146) |
To merge this branch: | bzr merge lp:~jimbaker/juju-jitsu/watch-failfast |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mark Mims (community) | Approve | ||
Review via email: mp+118835@code.launchpad.net |
Description of the change
Adds support for --failfast option, which immediately terminates the watch with exit code 1 if any condition is watching for a service unit (or as implied with a service using --state/--x-state). Also this branch refactors the watch script to use an instance of WatchManager to manage various parameters instead of passing through a bunch of functions.
$ jitsu watch -e testbed --failfast mysql --state=started foobar --state=started
2012-08-08 15:35:38,824 juju.common:INFO Connecting to environment...
2012-08-08 15:35:42,436 juju.common:INFO Connected to environment.
2012-08-08 15:35:42,436 watch:INFO Waiting for mysql service...
2012-08-08 15:35:42,436 watch:INFO Waiting for foobar service...
2012-08-08 15:35:42,735 watch:INFO Completed waiting for mysql service
2012-08-08 15:35:43,054 watch:INFO Waiting for unit mysql/1...
2012-08-08 15:35:43,409 watch:INFO Waiting for unit mysql/1 to be in [error, install-error, start-error, started, stop-error] and not in []
2012-08-08 15:35:43,955 watch:INFO Completed waiting for unit mysql/1 state: start-error
2012-08-08 15:35:43,955 watch:ERROR Failed fast: Unit mysql/1 in error state: start-error
Unit mysql/1 in error state: start-error
2012-08-08 15:35:43,956 watch:INFO Completed waiting for unit mysql/1
mysql
lgtm