From 6694ef29a3f300c072b4b0dff8da35f765e13ab1 Mon Sep 17 00:00:00 2001 From: Felipe Signorini Date: Sat, 26 Jan 2019 22:49:57 +0000 Subject: [PATCH] bugfix vcpu and memory cal --- app/services/hooks/aws.py | 4 ++-- app/services/hooks/azure.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/services/hooks/aws.py b/app/services/hooks/aws.py index 18b809e..91885b2 100644 --- a/app/services/hooks/aws.py +++ b/app/services/hooks/aws.py @@ -28,8 +28,8 @@ def cpuAndMemoryByInstanceType(obj, conn): if vcpus and memory: data = { - 'cpu': re.search(r'([0-9]*)', vcpus).group(), - 'memory': re.search(r'([0-9\.]*)', memory).group(), + 'cpu': int(re.search(r'([0-9]*)', vcpus).group()), + 'memory': float(re.search(r'([0-9\.]*)', memory).group()), } CacheMemory.set(instance, data) diff --git a/app/services/hooks/azure.py b/app/services/hooks/azure.py index affdc4e..c2d6517 100644 --- a/app/services/hooks/azure.py +++ b/app/services/hooks/azure.py @@ -92,8 +92,8 @@ def cpuAndMemoryByInstanceType(obj, conn): if vcpus and memory: data = { - 'cpu': vcpus, - 'memory': memory, + 'cpu': int(vcpus), + 'memory': float(memory), } CacheMemory.set(instance, data)