diff options
| author | Matthew Sherborne <msherborne@gmail.com> | 2013-03-07 08:06:21 +1000 |
|---|---|---|
| committer | Matthew Sherborne <msherborne@gmail.com> | 2013-03-12 09:04:16 +1000 |
| commit | 782dd69de4c6661eeb889b4e5b3b1b8df9d228b6 (patch) | |
| tree | 16f399a50a95dfbeb23b33787453632ebb42fc31 /nova/api | |
| parent | 4c5fb5657a38c9206bd91c1253b1a2456c1cd37f (diff) | |
Prepare services index method for use with cells
Move the api.openstack.compute.contrib.services' index method's logic
out of the openstack api layer and into the compute api layer.
The addition of the availability_zone information is already done by the
host api. For this reason it was removed from the openstack api layer.
The behaviour of the call remains the same, only the functionality has
been moved.
This patch makes the functionality automatically work in cells.
Work towards: bug #1150499
Change-Id: Ia9489f11608167aed5168ccb3b670f395f7de5f7
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/services.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/nova/api/openstack/compute/contrib/services.py b/nova/api/openstack/compute/contrib/services.py index 3afd5ff45..fb7b9d591 100644 --- a/nova/api/openstack/compute/contrib/services.py +++ b/nova/api/openstack/compute/contrib/services.py @@ -20,7 +20,7 @@ import webob.exc from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova.api.openstack import xmlutil -from nova import availability_zones +from nova import compute from nova import db from nova import exception from nova.openstack.common import log as logging @@ -58,6 +58,10 @@ class ServicesUpdateTemplate(xmlutil.TemplateBuilder): class ServiceController(object): + + def __init__(self): + self.host_api = compute.HostAPI() + @wsgi.serializers(xml=ServicesIndexTemplate) def index(self, req): """ @@ -66,8 +70,8 @@ class ServiceController(object): context = req.environ['nova.context'] authorize(context) now = timeutils.utcnow() - services = db.service_get_all(context) - services = availability_zones.set_availability_zones(context, services) + services = self.host_api.service_get_all( + context, set_zones=True) host = '' if 'host' in req.GET: |
