Merge lp://staging/~sinzui/juju-release-tools/joyent-safe-delete into lp://staging/juju-release-tools
Status: | Merged |
---|---|
Merged at revision: | 155 |
Proposed branch: | lp://staging/~sinzui/juju-release-tools/joyent-safe-delete |
Merge into: | lp://staging/juju-release-tools |
Diff against target: |
269 lines (+167/-18) 3 files modified
joyent.py (+33/-18) tests/test_joyent.py (+106/-0) utils.py (+28/-0) |
To merge this branch: | bzr merge lp://staging/~sinzui/juju-release-tools/joyent-safe-delete |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Aaron Bentley (community) | Approve | ||
Review via email:
|
Description of the change
Do not delete old machines with the tag permanent: true.
This branch has more changes then anticipated because adding a test suite revealed issues that needed fixing or refactoring.
1. added tests for the part I planned to change.
2. Fix bug where parser.parse_args wasn't using the args that were passed it its function;
the parser was seeing the args passed to the test suite :(
3. Update the client class and argparer to take a key_path arg
because I saw the tests were using my personal env.
4. Add pause=3 to the client because I saw the tests were sleeping 3 seconds.
The tests pass 0 for no sleep.
5. Only print when verbose is true; I saw the prints in the test output.
6. Extracted _delete_
to separate the decision to delete from the act of deletion.
7. Added a rule to check if a permanent tag exists and if it is true to skip deletion.
This changes the signature of Client.__init__, which breaks compatibility with juju-ci-tools. Please don't land it without also landing a fix for juju-ci-tools.
See also inline.