Merge "Fix the bug of "openstack usage show""
This commit is contained in:
commit
53fc20fa6f
@ -183,10 +183,18 @@ class ShowUsage(show.ShowOne):
|
|||||||
))
|
))
|
||||||
|
|
||||||
info = {}
|
info = {}
|
||||||
info['Servers'] = len(usage.server_usages)
|
info['Servers'] = (
|
||||||
info['RAM MB-Hours'] = float("%.2f" % usage.total_memory_mb_usage)
|
len(usage.server_usages)
|
||||||
info['CPU Hours'] = float("%.2f" % usage.total_vcpus_usage)
|
if hasattr(usage, "server_usages") else None)
|
||||||
info['Disk GB-Hours'] = float("%.2f" % usage.total_local_gb_usage)
|
info['RAM MB-Hours'] = (
|
||||||
|
float("%.2f" % usage.total_memory_mb_usage)
|
||||||
|
if hasattr(usage, "total_memory_mb_usage") else None)
|
||||||
|
info['CPU Hours'] = (
|
||||||
|
float("%.2f" % usage.total_vcpus_usage)
|
||||||
|
if hasattr(usage, "total_vcpus_usage") else None)
|
||||||
|
info['Disk GB-Hours'] = (
|
||||||
|
float("%.2f" % usage.total_local_gb_usage)
|
||||||
|
if hasattr(usage, "total_local_gb_usage") else None)
|
||||||
return zip(*sorted(six.iteritems(info)))
|
return zip(*sorted(six.iteritems(info)))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user