Commit 82cfcf09 by btimby

Unmount ArchiveFS when ArchiveMountFS goes away, close archives when ArchiveFS…

Unmount ArchiveFS when ArchiveMountFS goes away, close archives when ArchiveFS goes away (and is unmounted)
parent 19509ddc
......@@ -79,6 +79,9 @@ class ArchiveFS(FS):
else:
self.contents[part] = libarchive.Entry(pathname=part, mode=stat.S_IFDIR, size=0, mtime=item.mtime)
def __del__(self):
self.close()
def __str__(self):
return "<ArchiveFS: %s>" % self.root_path
......@@ -197,6 +200,11 @@ class ArchiveMountFS(mountfs.MountFS):
self.rootfs = rootfs
self.mountdir('/', rootfs)
def __del__(self):
# Umount everything that we mounted.
for mountpoint in self.mount_tree.keys():
self.unmount(mountpoint)
def ismount(self, path):
try:
object = self.mount_tree[path]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment