Fix _get_tenant_volume_usages
The search opts for volume/snapshot list should be 'all_tenants' and 'project_id' instead of 'alltenants' and 'tenant_id'. Change-Id: I9ab71421447b3f8fb402247df3290fa3066bf8c5 Closes-bug: #1469589
This commit is contained in:
parent
dd694cdef3
commit
faa44bfe1d
@ -77,7 +77,7 @@ class QuotaTests(test.APITestCase):
|
||||
api.nova.server_list(IsA(http.HttpRequest), search_opts=search_opts,
|
||||
all_tenants=True) \
|
||||
.AndReturn([servers, False])
|
||||
opts = {'alltenants': 1, 'tenant_id': self.request.user.tenant_id}
|
||||
opts = {'all_tenants': 1, 'project_id': self.request.user.tenant_id}
|
||||
cinder.volume_list(IsA(http.HttpRequest), opts) \
|
||||
.AndReturn(self.volumes.list())
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest), opts) \
|
||||
@ -201,7 +201,7 @@ class QuotaTests(test.APITestCase):
|
||||
api.nova.server_list(IsA(http.HttpRequest), search_opts=search_opts,
|
||||
all_tenants=True) \
|
||||
.AndReturn([servers, False])
|
||||
opts = {'alltenants': 1, 'tenant_id': self.request.user.tenant_id}
|
||||
opts = {'all_tenants': 1, 'project_id': self.request.user.tenant_id}
|
||||
cinder.volume_list(IsA(http.HttpRequest), opts) \
|
||||
.AndReturn(self.volumes.list())
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest), opts) \
|
||||
@ -246,7 +246,7 @@ class QuotaTests(test.APITestCase):
|
||||
api.nova.server_list(IsA(http.HttpRequest), search_opts=search_opts,
|
||||
all_tenants=True) \
|
||||
.AndReturn([servers, False])
|
||||
opts = {'alltenants': 1, 'tenant_id': self.request.user.tenant_id}
|
||||
opts = {'all_tenants': 1, 'project_id': self.request.user.tenant_id}
|
||||
cinder.volume_list(IsA(http.HttpRequest), opts) \
|
||||
.AndReturn(self.volumes.list())
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest), opts) \
|
||||
|
@ -328,7 +328,7 @@ def _get_tenant_network_usages(request, usages, disabled_quotas, tenant_id):
|
||||
def _get_tenant_volume_usages(request, usages, disabled_quotas, tenant_id):
|
||||
if 'volumes' not in disabled_quotas:
|
||||
if tenant_id:
|
||||
opts = {'alltenants': 1, 'tenant_id': tenant_id}
|
||||
opts = {'all_tenants': 1, 'project_id': tenant_id}
|
||||
volumes = cinder.volume_list(request, opts)
|
||||
snapshots = cinder.volume_snapshot_list(request, opts)
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user