From 3e43c3f30a685893f0499c3732249d8fbbbcdb59 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Tue, 30 Jul 2013 01:40:54 +0000 Subject: [PATCH] Hopefully correct my cpu math. --- scripts/ans-vhost-freemem | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/ans-vhost-freemem b/scripts/ans-vhost-freemem index c5c4dd71f2..7fd0147172 100755 --- a/scripts/ans-vhost-freemem +++ b/scripts/ans-vhost-freemem @@ -70,8 +70,7 @@ for hn in sorted(res['contacted']): if 'failed' in res['contacted'][hn] and res['contacted'][hn]['failed']: continue mem_per_host[hn] = int(res['contacted'][hn]['phymemory']) - cpu_per_host[hn] = int(res['contacted'][hn]['cpus']) * \ - int(res['contacted'][hn]['cpucores']) + cpu_per_host[hn] = int(res['contacted'][hn]['cpus']) ans = ansible.runner.Runner( @@ -106,7 +105,7 @@ for hn in sorted(res['contacted']): for hn in sorted(mem_per_host): freemem = mem_per_host[hn] - mem_used_in_vm[hn] freecpu = cpu_per_host[hn] - cpu_used_in_vm[hn] - print '%s:\t%s mem\t%s/%s cores' % ( + print '%s:\t%s mem\t%s/%s cpus' % ( hn, freemem, freecpu, cpu_per_host[hn])