[placement] Unregister the UsageList object

Unregister the UsageList object because we do not need RPC
and versioning for the objects in nova.objects.resource_provider.

There are two primary changes here:

* unregistering the UsageList class
* where objects.UsageList is used, point directly to the
  nova.objects.resource_provider package instead

Partially-Implements: bp placement-deregister-objects
Change-Id: Id1d3aeaf5831e0804016e98511f719705e9da706
This commit is contained in:
Chris Dent 2017-09-08 17:35:52 +01:00
parent 64c89005a8
commit c5ffc0c9ce

@ -21,6 +21,7 @@ from nova.api.openstack.placement import wsgi_wrapper
from nova import exception
from nova.i18n import _
from nova import objects
from nova.objects import resource_provider as rp_obj
# Represents the allowed query string parameters to GET /usages
@ -78,7 +79,7 @@ def list_usages(req):
_("No resource provider with uuid %(uuid)s found: %(error)s") %
{'uuid': uuid, 'error': exc})
usage = objects.UsageList.get_all_by_resource_provider_uuid(
usage = rp_obj.UsageList.get_all_by_resource_provider_uuid(
context, uuid)
response = req.response
@ -107,8 +108,8 @@ def get_total_usages(req):
project_id = req.GET.get('project_id')
user_id = req.GET.get('user_id')
usages = objects.UsageList.get_all_by_project_user(context, project_id,
user_id=user_id)
usages = rp_obj.UsageList.get_all_by_project_user(context, project_id,
user_id=user_id)
response = req.response
usages_dict = {'usages': {resource.resource_class: resource.usage