Merge "Update fields of CSV reports."
This commit is contained in:
@@ -39,12 +39,11 @@ class CSVMapped(csv_base.BaseCSVBackend):
|
|||||||
('UserId', 'desc:user_id'),
|
('UserId', 'desc:user_id'),
|
||||||
('ProjectId', 'desc:project_id'),
|
('ProjectId', 'desc:project_id'),
|
||||||
('ItemName', 'desc:name'),
|
('ItemName', 'desc:name'),
|
||||||
('ItemFlavor', 'desc:flavor'),
|
('ItemFlavor', 'desc:flavor_name'),
|
||||||
|
('ItemFlavorId', 'desc:flavor_id'),
|
||||||
('AvailabilityZone', 'desc:availability_zone'),
|
('AvailabilityZone', 'desc:availability_zone'),
|
||||||
('Service', self._trans_service),
|
('Service', self._trans_service),
|
||||||
('ItemDescription', 'rating:description'),
|
|
||||||
('UsageQuantity', 'vol:qty'),
|
('UsageQuantity', 'vol:qty'),
|
||||||
('RateId', 'rating:rate_id'),
|
|
||||||
('RateValue', 'rating:price'),
|
('RateValue', 'rating:price'),
|
||||||
('Cost', self._trans_calc_cost),
|
('Cost', self._trans_calc_cost),
|
||||||
('user:*', 'desc:metadata:*')])
|
('user:*', 'desc:metadata:*')])
|
||||||
@@ -136,8 +135,7 @@ class CSVMapped(csv_base.BaseCSVBackend):
|
|||||||
"""Context dependent resource id transformation function.
|
"""Context dependent resource id transformation function.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if context == 'compute':
|
return report_data['desc'].get('resource_id')
|
||||||
return report_data['desc'].get('instance_id')
|
|
||||||
|
|
||||||
def _trans_calc_cost(self, context, report_data):
|
def _trans_calc_cost(self, context, report_data):
|
||||||
"""Cost calculation function.
|
"""Cost calculation function.
|
||||||
|
|||||||
Reference in New Issue
Block a user