Merge ~oddbloke/cloud-init/+git/cloud-init:clean into cloud-init:master
Proposed by
Dan Watkins
Status: | Merged |
---|---|
Approved by: | Dan Watkins |
Approved revision: | 5d08d32fad4673515307b811b41e454368a052ab |
Merge reported by: | Server Team CI bot |
Merged at revision: | not available |
Proposed branch: | ~oddbloke/cloud-init/+git/cloud-init:clean |
Merge into: | cloud-init:master |
Diff against target: |
29 lines (+4/-2) 2 files modified
cloudinit/cmd/clean.py (+2/-1) cloudinit/cmd/tests/test_clean.py (+2/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Server Team CI bot | continuous-integration | Approve | |
Ryan Harper | Approve | ||
Review via email: mp+363936@code.launchpad.net |
Commit message
clean: correctly determine the path for excluding seed directory
Previously, init.paths.
"/var/lib/
(of course), never matching.
In this commit, switch to using os.path.join to avoid this case (and
update the tests to catch it in future).
LP: #1818571
To post a comment you must log in.
I manually applied your change to test_clean and it does trip the check that seed_dir is not removed.
======= ======= ======= ======= ======= ======= ======= ======= ======= ======= cmd.tests. test_clean. TestClean. test_remove_ artifacts_ removes_ artifacts_ skipping_ seed ------- ------- ------- ------- ------- ------- ------- ------- ------- rharper/ work/git/ cloud-init/ cloudinit/ cmd/tests/ test_clean. py", line 99, in test_remove_ artifacts_ removes_ artifacts_ skipping_ seed expected_ dir)) TestClean. f5keq5q_ /artifacts/ seed dir ------- ------ >> begin captured logging << ------- ------- ------ TestClean. f5keq5q_ /artifacts/ seed TestClean. f5keq5q_ /artifacts/ seed TestClean. f5keq5q_ /artifacts/ dir2 TestClean. f5keq5q_ /artifacts/ dir2 TestClean. f5keq5q_ /artifacts/ dir1 TestClean. f5keq5q_ /artifacts/ dir1 ------- ------- >> end captured logging << ------- ------- -------
FAIL: cloudinit.
-------
Traceback (most recent call last):
File "/home/
'Missing {0} dir'.format(
AssertionError: False is not true : Missing /tmp/ci-
-------
cloudinit.util: DEBUG: Testing if a link exists for /tmp/ci-
cloudinit.util: DEBUG: Recursively deleting /tmp/ci-
cloudinit.util: DEBUG: Testing if a link exists for /tmp/ci-
cloudinit.util: DEBUG: Recursively deleting /tmp/ci-
cloudinit.util: DEBUG: Testing if a link exists for /tmp/ci-
cloudinit.util: DEBUG: Recursively deleting /tmp/ci-
-------
------- ------- ------- ------- ------- ------- ------- ------- ------- -------
Ran 8 tests in 0.012s
Approved if CI says yes as well.