From d0fadaab6628df011828595c3e0cb09b1b936cc2 Mon Sep 17 00:00:00 2001 From: Wagner Souza Date: Thu, 12 Feb 2015 13:51:35 -0200 Subject: [PATCH] project: list total,used,free values --- infrastructure.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/infrastructure.py b/infrastructure.py index ceb09ef..2027238 100755 --- a/infrastructure.py +++ b/infrastructure.py @@ -112,15 +112,17 @@ def list_projects(): t = PrettyTable(['Project', 'Account', 'CPU', 'MEM (GB)', 'Pri Stg (GB)', 'Sec Stg (GB)', 'Templates', 'VM', 'Volume']) t.align['Project'] = 'l' + t.add_row(["","","total/used/free","total/used/free","total/used/free","total/used/free","total/used/free","total/used/free","total/used/free"]) + t.add_row([" ","","","","","","","",""]) for res in result['project']: t.add_row([res['name'], res['account'], - "%s/%s" % (res['cputotal'], res['cpulimit']), - "%s/%s" % (int(res['memorytotal'])/1024, int(res['memorylimit'])/1024), - "%s/%s" % (res['primarystoragetotal'], res['primarystoragelimit']), - "%s/%s" % (res['secondarystoragetotal'], res['secondarystoragelimit']), - "%s/%s" % (res['templatetotal'], res['templatelimit']), - "%s/%s" % (res['vmtotal'], res['vmlimit']), - "%s/%s" % (res['volumetotal'], res['volumelimit'])]) + "%s/%s/%s" % (res['cpulimit'], res['cputotal'], res['cpuavailable']), + "%s/%s/%s" % (int(res['memorylimit'])/1024, int(res['memorytotal'])/1024, int(res['memoryavailable'])/1024), + "%s/%s/%s" % (res['primarystoragelimit'], res['primarystoragetotal'], res['primarystorageavailable']), + "%s/%s/%s" % (res['secondarystoragelimit'], res['secondarystoragetotal'], res['secondarystorageavailable']), + "%s/%s/%s" % (res['templatelimit'], res['templatetotal'], res['templateavailable']), + "%s/%s/%s" % (res['vmlimit'], res['vmtotal'], res['vmavailable']), + "%s/%s/%s" % (res['volumelimit'], res['volumetotal'], res['volumeavailable'])]) return t.get_string(sortby="Project")