Skip to content

Commit

Permalink
Set usage to 0 if attribute not present
Browse files Browse the repository at this point in the history
This fixes bug #956989

Change-Id: If673dff48806642c866c593ab0575a470906cb2d
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
  • Loading branch information
Julien Danjou committed Mar 16, 2012
1 parent f00f177 commit cefb135
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion horizon/api/nova.py
Expand Up @@ -413,7 +413,7 @@ def tenant_quota_usages(request):
for instance in instances:
for flavor_field in usages[usage]['flavor_fields']:
usages[usage]['used'] += getattr(
flavors[instance.flavor['id']], flavor_field)
flavors[instance.flavor['id']], flavor_field, 0)
usages[usage]['quota'] = getattr(quotas, usage)
usages[usage]['available'] = usages[usage]['quota'] - \
usages[usage]['used']
Expand Down

0 comments on commit cefb135

Please sign in to comment.