'Gets capacity info for an aggregate.'

def get_aggregate_capacity(self, aggregate_name):

    desired_attributes = {'aggr-attributes': {'aggr-space-attributes': {'percent-used-capacity': None, 'size-available': None, 'size-total': None}}}
    try:
        aggrs = self._get_aggregates(aggregate_names=[aggregate_name], desired_attributes=desired_attributes)
    except netapp_api.NaApiError as e:
        if (e.code == netapp_api.EAPINOTFOUND):
            LOG.debug('Aggregate    capacity    can    only    be    collected    with    cluster    scoped    credentials.')
        else:
            LOG.exception('Failed    to    get    info    for    aggregate    %s.', aggregate_name)
        return {}
    if (len(aggrs) < 1):
        return {}
    aggr_attributes = aggrs[0]
    aggr_space_attributes = (aggr_attributes.get_child_by_name('aggr-space-attributes') or netapp_api.NaElement('none'))
    percent_used = int(aggr_space_attributes.get_child_content('percent-used-capacity'))
    size_available = float(aggr_space_attributes.get_child_content('size-available'))
    size_total = float(aggr_space_attributes.get_child_content('size-total'))
    return {'percent-used': percent_used, 'size-available': size_available, 'size-total': size_total}
