Merge "Fix leak of loop/nbd devices in injection using localfs"

This commit is contained in:
Jenkins 2013-02-20 13:38:39 +00:00 committed by Gerrit Code Review
commit 96a4518575
2 changed files with 3 additions and 3 deletions

View File

@ -211,11 +211,11 @@ class Mount(object):
finally:
if not status:
LOG.debug(_("Fail to mount, tearing back down"))
self.do_umount()
self.do_teardown()
return status
def do_umount(self):
"""Call the unmnt, unmap and unget operations."""
"""Call the unmnt operation."""
if self.mounted:
self.unmnt_dev()

View File

@ -85,7 +85,7 @@ class VFSLocalFS(vfs.VFS):
def teardown(self):
try:
if self.mount:
self.mount.do_umount()
self.mount.do_teardown()
except Exception, e:
LOG.debug(_("Failed to unmount %(imgdir)s: %(ex)s") %
{'imgdir': self.imgdir, 'ex': str(e)})