The old stuff was trying to use an uninitialized local variable.
---
morphlib/app.py | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/morphlib/app.py b/morphlib/app.py
index 3fa84ac..491adb1 100755
--- a/morphlib/app.py
+++ b/morphlib/app.py
@@ -734,10 +734,11 @@ class Morph(cliapp.Application):
return mount_point
def cleanup(path, mount_point):
- try:
- morphlib.fsutils.unmount(self.runcmd, mount_point)
- except:
- pass
+ if mount_point is not None:
+ try:
+ morphlib.fsutils.unmount(self.runcmd, mount_point)
+ except:
+ pass
try:
morphlib.fsutils.undo_device_mapping(self.runcmd, path)
except:
@@ -747,6 +748,8 @@ class Morph(cliapp.Application):
except:
pass
+ mount_point_1 = None
+ mount_point_2 = None
try:
mount_point_1 = setup(image_path_1)
mount_point_2 = setup(image_path_2)
--
1.7.2.5