Skip to content

Commit

Permalink
Fix errors in used_limits extension
Browse files Browse the repository at this point in the history
Fixes bug #1062049

There was a typo mapping the security groups resource to floating IPs.

Volumes usage isn't tracked by Nova any more since delete-nova-volume.

Key pairs don't work with the extension because of bug #1089877.

Change-Id: Ifd694b21fef1dc95e67c07dcef0cd6ea3daa8d53
  • Loading branch information
markmc committed Dec 13, 2012
1 parent dc48ce7 commit 6c9d9ab
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 14 deletions.
4 changes: 2 additions & 2 deletions doc/api_samples/os-used-limits/usedlimits-get-resp.json
Expand Up @@ -14,9 +14,9 @@
"maxTotalRAMSize": 51200,
"totalCoresUsed": 0,
"totalInstancesUsed": 0,
"totalKeyPairsUsed": 0,
"totalRAMUsed": 0,
"totalSecurityGroupsUsed": 0
"totalSecurityGroupsUsed": 0,
"totalFloatingIpsUsed": 0
},
"rate": [
{
Expand Down
2 changes: 1 addition & 1 deletion doc/api_samples/os-used-limits/usedlimits-get-resp.xml
Expand Up @@ -26,10 +26,10 @@
<limit name="totalRAMUsed" value="0"/>
<limit name="totalInstancesUsed" value="0"/>
<limit name="maxSecurityGroups" value="10"/>
<limit name="totalFloatingIpsUsed" value="0"/>
<limit name="maxTotalCores" value="20"/>
<limit name="totalSecurityGroupsUsed" value="0"/>
<limit name="maxTotalFloatingIps" value="10"/>
<limit name="totalKeyPairsUsed" value="0"/>
<limit name="maxTotalInstances" value="10"/>
<limit name="totalCoresUsed" value="0"/>
<limit name="maxTotalRAMSize" value="51200"/>
Expand Down
6 changes: 2 additions & 4 deletions nova/api/openstack/compute/contrib/used_limits.py
Expand Up @@ -56,10 +56,8 @@ def index(self, req, resp_obj):
'totalRAMUsed': 'ram',
'totalCoresUsed': 'cores',
'totalInstancesUsed': 'instances',
'totalVolumesUsed': 'volumes',
'totalVolumeGigabytesUsed': 'gigabytes',
'totalSecurityGroupsUsed': 'floating_ips',
'totalKeyPairsUsed': 'key_pairs',
'totalFloatingIpsUsed': 'floating_ips',
'totalSecurityGroupsUsed': 'security_groups',
}
used_limits = {}
for display_name, quota in quota_map.iteritems():
Expand Down
6 changes: 2 additions & 4 deletions nova/tests/api/openstack/compute/contrib/test_used_limits.py
Expand Up @@ -52,10 +52,8 @@ def _do_test_used_limits(self, reserved):
'totalRAMUsed': 'ram',
'totalCoresUsed': 'cores',
'totalInstancesUsed': 'instances',
'totalVolumesUsed': 'volumes',
'totalVolumeGigabytesUsed': 'gigabytes',
'totalSecurityGroupsUsed': 'floating_ips',
'totalKeyPairsUsed': 'key_pairs',
'totalFloatingIpsUsed': 'floating_ips',
'totalSecurityGroupsUsed': 'security_groups',
}
limits = {}
for display_name, q in quota_map.iteritems():
Expand Down
Expand Up @@ -14,9 +14,9 @@
"maxTotalRAMSize": 51200,
"totalCoresUsed": 0,
"totalInstancesUsed": 0,
"totalKeyPairsUsed": 0,
"totalRAMUsed": 0,
"totalSecurityGroupsUsed": 0
"totalSecurityGroupsUsed": 0,
"totalFloatingIpsUsed": 0
},
"rate": [
{
Expand Down
Expand Up @@ -31,7 +31,7 @@
<limit name="maxTotalCores" value="20"/>
<limit name="totalSecurityGroupsUsed" value="0"/>
<limit name="maxTotalFloatingIps" value="10"/>
<limit name="totalKeyPairsUsed" value="0"/>
<limit name="totalFloatingIpsUsed" value="0"/>
<limit name="maxTotalRAMSize" value="51200"/>
</absolute>
</limits>

0 comments on commit 6c9d9ab

Please sign in to comment.