Merge lp://staging/~sinzui/juju-release-tools/joyent-safe-delete into lp://staging/juju-release-tools

Proposed by Curtis Hovey
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
Reviewer Review Type Date Requested Status
Aaron Bentley (community) Approve
Review via email: mp+248917@code.staging.launchpad.net

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_running_machine() from delete_old_machines()
   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.

To post a comment you must log in.
Revision history for this message
Aaron Bentley (abentley) wrote :

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.

review: Approve
164. By Curtis Hovey

autospec.

165. By Curtis Hovey

Added until_timeout to ensure the script doesn't wait forever for a machine to stop.

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