Merge "Fix leak of loop/nbd devices in injection using localfs"
This commit is contained in:
commit
96a4518575
@ -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()
|
||||
|
||||
|
@ -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)})
|
||||
|
Loading…
Reference in New Issue
Block a user