Fix leak of loop/nbd devices in injection using localfs
Call do_teardown() rather than do_umount() bug 1130080 Change-Id: I0dd4e4990f75917628007fd380f7df531d9a79e5
This commit is contained in:
parent
1b9b66ba21
commit
e3fe55df23
|
@ -211,11 +211,11 @@ class Mount(object):
|
||||||
finally:
|
finally:
|
||||||
if not status:
|
if not status:
|
||||||
LOG.debug(_("Fail to mount, tearing back down"))
|
LOG.debug(_("Fail to mount, tearing back down"))
|
||||||
self.do_umount()
|
self.do_teardown()
|
||||||
return status
|
return status
|
||||||
|
|
||||||
def do_umount(self):
|
def do_umount(self):
|
||||||
"""Call the unmnt, unmap and unget operations."""
|
"""Call the unmnt operation."""
|
||||||
if self.mounted:
|
if self.mounted:
|
||||||
self.unmnt_dev()
|
self.unmnt_dev()
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ class VFSLocalFS(vfs.VFS):
|
||||||
def teardown(self):
|
def teardown(self):
|
||||||
try:
|
try:
|
||||||
if self.mount:
|
if self.mount:
|
||||||
self.mount.do_umount()
|
self.mount.do_teardown()
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
LOG.debug(_("Failed to unmount %(imgdir)s: %(ex)s") %
|
LOG.debug(_("Failed to unmount %(imgdir)s: %(ex)s") %
|
||||||
{'imgdir': self.imgdir, 'ex': str(e)})
|
{'imgdir': self.imgdir, 'ex': str(e)})
|
||||||
|
|
Loading…
Reference in New Issue