def umount_all(root_path):
    """
    Unmount all devices with mount points contained in ``root_path``.

    :param FilePath root_path: A directory in which to search for mount points.
    """
    def is_under_root(path):
        try:
            FilePath(path).segmentsFrom(root_path)
        except __HOLE__:
            return False
        return True

    partitions_under_root = list(p for p in psutil.disk_partitions()
                                 if is_under_root(p.mountpoint))
    for partition in partitions_under_root:
        umount(FilePath(partition.mountpoint))
dataset/ETHPy150Open ClusterHQ/flocker/flocker/node/agents/testtools/_blockdevice.py/umount_all