def _get_detailed_reference_data(quota): reference_data = [] for name, values in quota.to_dict().items(): if type(values) is dict: if 'used' in values: # For network quota it's "used" key instead of "in_use" in_use = values['used'] else: in_use = values['in_use'] resource_values = [in_use, values['reserved'], values['limit']] reference_data.append(tuple([name] + resource_values)) return reference_data
def _get_detailed_reference_data(quota): reference_data = [] for name, values in quota.to_dict().items(): if type(values) is dict: if 'used' in values: # For network quota it's "used" key instead of "in_use" in_use = values['used'] else: in_use = values['in_use'] resource_values = [ in_use, values['reserved'], values['limit']] reference_data.append(tuple([name] + resource_values)) return reference_data