Merge "Fix volume storage usage value"
This commit is contained in:
commit
c16c950d40
@ -67,7 +67,7 @@ class QuotaTests(test.APITestCase):
|
||||
usages.update({'volumes': {'available': 0, 'used': 4, 'quota': 1},
|
||||
'snapshots': {'available': 0, 'used': 3,
|
||||
'quota': 1},
|
||||
'gigabytes': {'available': 880, 'used': 120,
|
||||
'gigabytes': {'available': 600, 'used': 400,
|
||||
'quota': 1000}})
|
||||
return usages
|
||||
|
||||
|
@ -381,7 +381,9 @@ def _get_tenant_volume_usages(request, usages, disabled_quotas, tenant_id):
|
||||
else:
|
||||
volumes = cinder.volume_list(request)
|
||||
snapshots = cinder.volume_snapshot_list(request)
|
||||
usages.tally('gigabytes', sum([int(v.size) for v in volumes]))
|
||||
volume_usage = sum([int(v.size) for v in volumes])
|
||||
snapshot_usage = sum([int(s.size) for s in snapshots])
|
||||
usages.tally('gigabytes', (snapshot_usage + volume_usage))
|
||||
usages.tally('volumes', len(volumes))
|
||||
usages.tally('snapshots', len(snapshots))
|
||||
except cinder.cinder_exception.ClientException:
|
||||
|
Loading…
Reference in New Issue
Block a user