Merge ~ines-almeida/launchpad:prevent-stray-temp-file-on-exception into launchpad:master
Proposed by
Ines Almeida
Status: | Merged |
---|---|
Approved by: | Ines Almeida |
Approved revision: | 3c271b6d29db90cb616038bed3f054ce90ce0a16 |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~ines-almeida/launchpad:prevent-stray-temp-file-on-exception |
Merge into: | launchpad:master |
Diff against target: |
102 lines (+55/-3) 2 files modified
lib/lp/archivepublisher/diskpool.py (+15/-2) lib/lp/archivepublisher/tests/test_pool.py (+40/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Watson (community) | Approve | ||
Review via email: mp+440381@code.qastaging.launchpad.net |
Commit message
Cleanup temp files if copying component raises
If something goes wrong while copying a component, we:
* catch the exception (generally, whichever exception)
* do some cleanup of temporary files
* re-raise the same exception
LP: #1662671
Description of the change
Added a couple of unit tests that test:
- the cleanup method removes the temporary path
- the cleanup is called when an exception is raised, and the exact same exception is re-raised
To post a comment you must log in.
There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.