Merge lp://staging/~abentley/juju-ci-tools/prepare-testing-3 into lp://staging/juju-ci-tools

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 1845
Proposed branch: lp://staging/~abentley/juju-ci-tools/prepare-testing-3
Merge into: lp://staging/juju-ci-tools
Diff against target: 194 lines (+93/-29)
4 files modified
clean_maas.py (+20/-9)
prepare-testing.bash (+11/-20)
substrate.py (+17/-0)
tests/test_substrate.py (+45/-0)
To merge this branch: bzr merge lp://staging/~abentley/juju-ci-tools/prepare-testing-3
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+314649@code.staging.launchpad.net

Commit message

Only delete maas nodes acquired more than 2 hours in prepare-testing.

Description of the change

This branch updates prepare-testing to release nodes older than 2 hours.

Investigating the MAAS web UI determined that there were "events" associated with a MAAS node. It appeared that 'User acquiring node' was the earliest event associated with Juju provisioning a machine, so I used this.

So now, machines acquired less than 2 hours ago will not be torn down. Also, machines whose hostname prefix is not "juju-" will not be torn down. Is the hostname check a good idea? Not sure. Happy to remove if not.

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

I have two comments inline. We already discussed the juju- prefix issue on IRC. The commands you use are maas 2 only. See in line for maas 1 differences.

review: Approve (code)
1846. By Aaron Bentley

Fix clean_maas script, update to allow skipping recently-allocated.

1847. By Aaron Bentley

Switch prepare-testing.bash to clean_maas.py

1848. By Aaron Bentley

Remove prepare_maas.py

Revision history for this message
Aaron Bentley (abentley) wrote :

I didn't want to add a second implementation of version-checking, and I realized the existing clean_maas.py was already handling most of what I wanted, so I added functionality to substrate.MAASAccount and clean_maas instead.

clean_maas was broken; it used maas_account_from_config, which has been supplanted by maas_account_from_boot_config.

Please give it another look, as it is significantly different.

Revision history for this message
Curtis Hovey (sinzui) wrote :

Much nicer, thank you.

review: Approve (code)

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