'Calculate available space on path.'

def _get_available_capacity(self, path):

    try:
        self._verify_gpfs_path_state(path)
        mounted = True
    except exception.VolumeBackendAPIException:
        mounted = False
    if (not mounted):
        return (0, 0)
    (out, err) = self.gpfs_execute('df', '-P', '-B', '1', path, run_as_root=True)
    out = out.splitlines()[1]
    size = int(out.split()[1])
    available = int(out.split()[3])
    return (available, size)
