Fix ephemeral field name in quota computing

ephemeral is now part of an extension is now prefixed with OS-FLV-EXT-DATA.

This fixes bug #961965

Change-Id: I67fc7cd666fbf6c350eb0361a5f4e69d1842973b
This commit is contained in:
Julien Danjou 2012-03-19 10:38:43 +01:00 committed by Gabriel Hurley
parent 477c13a407
commit 7d3a0f4d15
2 changed files with 25 additions and 23 deletions

View File

@ -409,7 +409,9 @@ def tenant_quota_usages(request):
flavors = dict([(f.id, f) for f in flavor_list(request)])
usages = {'instances': {'flavor_fields': [], 'used': len(instances)},
'cores': {'flavor_fields': ['vcpus'], 'used': 0},
'gigabytes': {'flavor_fields': ['disk', 'ephemeral'], 'used': 0},
'gigabytes': {'used': 0,
'flavor_fields': ['disk',
'OS-FLV-EXT-DATA:ephemeral']},
'ram': {'flavor_fields': ['ram'], 'used': 0},
'floating_ips': {'flavor_fields': [], 'used': len(floating_ips)}}

View File

@ -178,25 +178,25 @@ class ComputeApiTests(test.APITestCase):
self.assertIsInstance(quota_usages, dict)
self.assertEquals(quota_usages,
{'gigabytes': {'available': 1000,
'used': 0,
'flavor_fields': ['disk',
'ephemeral'],
'quota': 1000},
'instances': {'available': 8,
'used': 2,
'flavor_fields': [],
'quota': 10},
'ram': {'available': 8976,
'used': 1024,
'flavor_fields': ['ram'],
'quota': 10000},
'cores': {'available': 8,
'used': 2,
'flavor_fields': ['vcpus'],
'quota': 10},
'floating_ips': {'available': 0,
'used': 1,
'flavor_fields': [],
'quota': 1}
})
{'gigabytes': {'available': 1000,
'used': 0,
'flavor_fields': ['disk',
'OS-FLV-EXT-DATA:ephemeral'],
'quota': 1000},
'instances': {'available': 8,
'used': 2,
'flavor_fields': [],
'quota': 10},
'ram': {'available': 8976,
'used': 1024,
'flavor_fields': ['ram'],
'quota': 10000},
'cores': {'available': 8,
'used': 2,
'flavor_fields': ['vcpus'],
'quota': 10},
'floating_ips': {'available': 0,
'used': 1,
'flavor_fields': [],
'quota': 1}
})