'Returns storage pools sorted on available capacity.'

def _get_sorted_available_storage_pools(self, size_gb):

    size = (size_gb * units.Gi)
    sorted_pools = sorted(self._get_storage_pools(), key=(lambda x: (int(x.get('totalRaidedSpace', 0)) - int(x.get('usedSpace', 0)))), reverse=True)
    avl_pools = filter((lambda x: ((int(x.get('totalRaidedSpace', 0)) - int(x.get('usedSpace', 0))) >= size)), sorted_pools)
    if (not avl_pools):
        LOG.warning('No    storage    pool    found    with    available    capacity    %s.', size_gb)
    return avl_pools
