Correct pricing for VMProduct

This commit is contained in:
Nico Schottelius 2020-03-05 14:00:14 +01:00
parent cf17373b3f
commit ec7a2a3c3a

View file

@ -62,9 +62,9 @@ class VMProduct(Product):
def recurring_price(self, recurring_period=RecurringPeriod.PER_MONTH): def recurring_price(self, recurring_period=RecurringPeriod.PER_MONTH):
# TODO: move magic numbers in variables # TODO: move magic numbers in variables
if recurring_period == RecurringPeriod.PER_MONTH: if recurring_period == RecurringPeriod.PER_MONTH:
return self.cores * 3 + self.ram_in_gb * 2 return self.cores * 3 + self.ram_in_gb * 4
elif recurring_period == RecurringPeriod.PER_HOUR: elif recurring_period == RecurringPeriod.PER_HOUR:
return self.cores * 4.0/(30 * 24) + self.ram_in_gb * 3.0/(30* 24) return self.cores * 4.0/(30 * 24) + self.ram_in_gb * 4.5/(30* 24)
else: else:
raise Exception('Invalid recurring period for VM Product pricing.') raise Exception('Invalid recurring period for VM Product pricing.')