Return cores as int

This commit is contained in:
PCoder 2019-04-09 08:56:10 +02:00
parent fa018739c9
commit 5b7d1301cf

View file

@ -100,7 +100,7 @@ class VirtualMachineSerializer(serializers.Serializer):
return manager.get_vm(opennebula_id) return manager.get_vm(opennebula_id)
def get_cores(self, obj): def get_cores(self, obj):
return float(obj.template.cpu) * 10 return int(float(obj.template.cpu) * 10)
def get_memory(self, obj): def get_memory(self, obj):
return int(obj.template.memory) / 1024 return int(obj.template.memory) / 1024