fix memory

This commit is contained in:
Solvik Blum 2020-04-14 13:22:43 +02:00
parent 4ee9325c7e
commit 7bfc0fd8a2

View file

@ -19,8 +19,8 @@ class VirtualMachine(object):
def get_memory(self):
mem_bytes = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') # e.g. 4015976448
mem_gib = mem_bytes/(1024.**3) # e.g. 3.74
return math.ceil(mem_gib)
mem_gib = mem_bytes / (1024.**2) # e.g. 3.74
return mem_gib
def get_vcpus(self):
return os.cpu_count()