summaryrefslogtreecommitdiff
path: root/morph
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-03-29 11:12:22 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2012-03-29 11:12:22 +0000
commita848a3bb32f338b85e06388250bff85141d87017 (patch)
treeaa33a8a79b7ae6cf462f5e90f8f29f5af94d20c1 /morph
parent07004dec02eda1f293a4a08238201e09396582a3 (diff)
downloadmorph-a848a3bb32f338b85e06388250bff85141d87017.tar.gz
morph: don't fail cleanup
If an exception happens, the cleanup may fail to cleanup something that wasn't yet set up. For now catch exceptions in cleanup. If you know a cleaner way let me know. Also remove a left-over print statement
Diffstat (limited to 'morph')
-rwxr-xr-xmorph11
1 files changed, 8 insertions, 3 deletions
diff --git a/morph b/morph
index 3d742f67..863e256b 100755
--- a/morph
+++ b/morph
@@ -380,7 +380,6 @@ class Morph(cliapp.Application):
paths = {}
for name in ('source', 'target'):
repo, ref, filename = trip_iter.next()
- print repo, ref, filename
treeish = src_manager.get_treeish(repo, ref)
morph = morph_loader.load(treeish, filename)
blob = morphlib.blobs.Blob.create_blob(morph)
@@ -404,8 +403,14 @@ class Morph(cliapp.Application):
# cleanup
for name in paths.iterkeys():
mount_point = tempdir.join('mnt_' + name)
- morphlib.fsutils.unmount(ex, mount_point)
- morphlib.fsutils.undo_device_mapping(ex, paths[name])
+ try:
+ morphlib.fsutils.unmount(ex, mount_point)
+ except:
+ pass
+ try:
+ morphlib.fsutils.undo_device_mapping(ex, paths[name])
+ except:
+ pass
factory.remove_staging()
def cmd_init(self, args):