glances: fix crasher

you need to call the function otherwise you will try running float() on
a function later when you try displaying it

Introduced in eda1cf5ba7
This commit is contained in:
Brandon Philips 2012-12-06 16:46:26 -08:00
parent 6f6277358f
commit 4964abeed1

View File

@ -728,12 +728,12 @@ class GlancesStats:
phymem = psutil.virtual_memory()
# buffers and cached (Linux, BSD)
buffers = getattr(phymem, 'buffers', lambda: 0)
cached = getattr(phymem, 'cached', lambda: 0)
buffers = getattr(phymem, 'buffers', lambda: 0)()
cached = getattr(phymem, 'cached', lambda: 0)()
# active and inactive not available on Windows
active = getattr(phymem, 'active', lambda: 0)
inactive = getattr(phymem, 'inactive', lambda: 0)
active = getattr(phymem, 'active', lambda: 0)()
inactive = getattr(phymem, 'inactive', lambda: 0)()
# phymem free and usage
total = phymem.total