Merge lp:~sil2100/ubuntu-cdimage/purge-core-images into lp:ubuntu-cdimage
Status: | Merged |
---|---|
Merged at revision: | 1790 |
Proposed branch: | lp:~sil2100/ubuntu-cdimage/purge-core-images |
Merge into: | lp:ubuntu-cdimage |
Diff against target: |
285 lines (+150/-30) 4 files modified
etc/purge-count (+2/-0) etc/purge-days (+1/-1) lib/cdimage/tests/test_tree.py (+97/-8) lib/cdimage/tree.py (+50/-21) |
To merge this branch: | bzr merge lp:~sil2100/ubuntu-cdimage/purge-core-images |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Steve Langasek | Approve | ||
Review via email: mp+356193@code.launchpad.net |
Commit message
Add support for another retention policy: purge-count. Refactor some of the purge code to support this better. Add tests. By default keep up to 5 core images.
Description of the change
Add support for another retention policy: purge-count. Refactor some of the purge code to support this better. Add tests. By default keep up to 5 core images.
This is my proposition of adding an additional purge policy to cdimage. The way it works is basically if no image-count based set is defined, the purge mechanics should work as they did before. One can define only one of them or both at once. In case a combination of age-based and count-based purging is defined, the first one to cause a purge wins. Example:
* If one defines keeping 3 days worth of images and up to 5 images, and 4 days-worth of images appear, the oldest one will be purged (leaving 3 images per age-count).
* If one defines keeping 5 days worth of images and up to 3 images, and 4 days-worth of images appear, the oldest one will be purged (leaving 3 images per image-count).
This can be useful in some future cases where we want to have this mixture of 'keep 3 days worth of images but not more than 5 at once'.
Mostly looks good, one comment inline, the other issue is that I don't actually see anywhere that you've implemented the "keep up to 5 core images" part of this.