Merge "Added quote calls to rating processors"

This commit is contained in:
Jenkins
2015-03-17 16:18:10 +00:00
committed by Gerrit Code Review
2 changed files with 10 additions and 1 deletions

View File

@@ -73,6 +73,15 @@ class BillingProcessorBase(object):
client.cast({}, operation, name=self.module_name)
return module_db.set_state(self.module_name, enabled)
def quote(self, data):
"""Compute rating informations from data.
:param data: An internal CloudKitty dictionary used to describe
resources.
:type data: dict(str:?)
"""
return self.process(data)
@abc.abstractmethod
def process(self, data):
"""Add billing informations to data

View File

@@ -124,7 +124,7 @@ class APIWorker(BaseWorker):
def quote(self, res_data):
for processor in self._processors.values():
processor.process(res_data)
processor.quote(res_data)
price = decimal.Decimal(0)
for res in res_data: