From 46b918d175791f7927a04dd1a2a370513edbeff3 Mon Sep 17 00:00:00 2001 From: Modulos Date: Sun, 14 May 2017 02:17:48 +0200 Subject: [PATCH] Fix price calculation --- hosting/models.py | 2 +- opennebula_api/serializers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hosting/models.py b/hosting/models.py index f8f180a5..25f852f1 100644 --- a/hosting/models.py +++ b/hosting/models.py @@ -41,7 +41,7 @@ class HostingPlan(models.Model): for cfg in cls.objects.all()] def price(self): - price = self.disk_size * 0.2 + price = self.disk_size * 0.6 price += self.cpu_cores * 5 price += self.memory * 2 return price diff --git a/opennebula_api/serializers.py b/opennebula_api/serializers.py index 48cdd7b6..44b873a5 100644 --- a/opennebula_api/serializers.py +++ b/opennebula_api/serializers.py @@ -135,7 +135,7 @@ class VirtualMachineSerializer(serializers.Serializer): def get_price(self, obj): template = obj.template - price = float(template.cpu) * 5.0 + price = float(template.vcpu) * 5.0 price += (int(template.memory)/1024 * 2.0) for disk in template.disks: price += int(disk.size)/1024 * 0.6