def get_monthly_cost_estimate(self, instance): manager = self.get_manager(instance) try: backend_instance = manager.get_node(instance.backend_id) except Exception as e: reraise(e) size = self.get_size(backend_instance.extra['instance_type'], manager) # calculate a price for current month based on hourly rate return size.price * hours_in_month()
def monthly_rate(self): return '%0.2f' % (self.value * core_utils.hours_in_month())