'Runs a number of tests on the expect Quobyte mount'

def _validate_volume(self, mount_path):

    partitions = psutil.disk_partitions(all=True)
    for p in partitions:
        if (mount_path == p.mountpoint):
            if p.device.startswith('quobyte@'):
                try:
                    statresult = os.stat(mount_path)
                    if (statresult.st_size == 0):
                        if (not os.access(mount_path, (os.W_OK | os.X_OK))):
                            LOG.warning('Volume    is    not    writable.    Please    broaden    the    file    permissions.    Mount:    %s', mount_path)
                        return
                    else:
                        msg = (_('The    mount    %(mount_path)s    is    not    a    valid    Quobyte    volume.    Stale    mount?') % {'mount_path': mount_path})
                    raise exception.VolumeDriverException(msg)
                except Exception as exc:
                    msg = (_('The    mount    %(mount_path)s    is    not    a    valid    Quobyte    volume.    Error:    %(exc)s    .        Possibly    a    Quobyte    client    crash?') % {'mount_path': mount_path, 'exc': exc})
                    raise exception.VolumeDriverException(msg)
            else:
                msg = (_('The    mount    %(mount_path)s    is    not    a    valid    Quobyte    volume    according    to    partition    list.') % {'mount_path': mount_path})
                raise exception.VolumeDriverException(msg)
    msg = (_('No    matching    Quobyte    mount    entry    for    %(mount_path)s    could    be    found    for    validation    in    partition    list.') % {'mount_path': mount_path})
    raise exception.VolumeDriverException(msg)
