def unmount()

in xar/deprecated/mount_xar.py [0:0]


def unmount(mounts, opts):
    for mount in mounts:
        devname, mountpoint, fstype = mount
        do_it, lock_fd = should_unmount(devname, mountpoint, fstype, opts.timeout)
        if do_it:
            logger.info("Attempting to unmount %s..." % mountpoint)
            subprocess.call(["umount", mountpoint])
            try:
                os.rmdir(mountpoint)
            except Exception:
                pass
            if lock_fd is not None:
                os.close(lock_fd)