diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2014-10-09 15:09:03 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2014-10-09 15:09:03 +0000 |
commit | 36332e59ef5a1e86b9b3188c9b9e09754bd0b695 (patch) | |
tree | 95f06905ad906794e756cfddf19815c052b030ba /morphlib/util_tests.py | |
parent | 120b16734079e5899b04f76a8c3c37c9a3ae8b3a (diff) | |
download | morph-36332e59ef5a1e86b9b3188c9b9e09754bd0b695.tar.gz |
ssh-rsync: Don't delete version if it existsbaserock/richardmaw/fix-ssh-rsync-destroying-versions
A quirk in the resource cleanup code meant that if you gave the same
version label when deploying a new version, then it would fail, then
remove the old version, as it had assumed that it was the one to create
those directories.
This patch fixes this issue by making short context managers for all the
resource allocation, so cleanup is done by walking up the context
managers, so only the mount and the temporary directory need to be
cleaned up if the `mkdir "$VERSION_ROOT"` fails.
I've tested this with a deploy of a version that doesn't already exist,
and the version I'm currently running, so I can conclusively say it's
fixed that problem.
Diffstat (limited to 'morphlib/util_tests.py')
0 files changed, 0 insertions, 0 deletions