imgcreate/fs.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit 5c0279b8e95682d20526a5ba36fc4eaab81d2198
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Thu Jan 31 13:47:24 2008 -0500
Only remove dirs if we are successful with the unmount (#430606)
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index 0591f1c..9ca3a3e 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -104,9 +104,10 @@ class LoopbackMount:
def unmount(self):
if self.mounted:
rc = subprocess.call(["/bin/umount", self.mountdir])
- self.mounted = False
+ if rc == 0:
+ self.mounted = False
- if self.rmdir:
+ if self.rmdir and not self.mounted:
try:
os.rmdir(self.mountdir)
except OSError, e:
Show replies by date