Merge "rp: fix up AllocList.get_by_resource_provider_uuid"
This commit is contained in:
commit
c7b6c18755
@ -192,19 +192,16 @@ def list_for_resource_provider(req):
|
|||||||
# confirm existence of resource provider so we get a reasonable
|
# confirm existence of resource provider so we get a reasonable
|
||||||
# 404 instead of empty list
|
# 404 instead of empty list
|
||||||
try:
|
try:
|
||||||
resource_provider = rp_obj.ResourceProvider.get_by_uuid(
|
rp = rp_obj.ResourceProvider.get_by_uuid(context, uuid)
|
||||||
context, uuid)
|
|
||||||
except exception.NotFound as exc:
|
except exception.NotFound as exc:
|
||||||
raise webob.exc.HTTPNotFound(
|
raise webob.exc.HTTPNotFound(
|
||||||
_("Resource provider '%(rp_uuid)s' not found: %(error)s") %
|
_("Resource provider '%(rp_uuid)s' not found: %(error)s") %
|
||||||
{'rp_uuid': uuid, 'error': exc})
|
{'rp_uuid': uuid, 'error': exc})
|
||||||
|
|
||||||
allocations = rp_obj.AllocationList.get_all_by_resource_provider_uuid(
|
allocs = rp_obj.AllocationList.get_all_by_resource_provider(context, rp)
|
||||||
context, uuid)
|
|
||||||
|
|
||||||
allocations_json = jsonutils.dumps(
|
allocations_json = jsonutils.dumps(
|
||||||
_serialize_allocations_for_resource_provider(
|
_serialize_allocations_for_resource_provider(allocs, rp))
|
||||||
allocations, resource_provider))
|
|
||||||
|
|
||||||
req.response.status = 200
|
req.response.status = 200
|
||||||
req.response.body = encodeutils.to_utf8(allocations_json)
|
req.response.body = encodeutils.to_utf8(allocations_json)
|
||||||
|
Loading…
Reference in New Issue
Block a user