diff options
-rw-r--r-- | nova/api/openstack/compute/contrib/services.py | 2 | ||||
-rw-r--r-- | nova/tests/api/openstack/compute/contrib/test_services.py | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/nova/api/openstack/compute/contrib/services.py b/nova/api/openstack/compute/contrib/services.py index c792c72da..2786ad814 100644 --- a/nova/api/openstack/compute/contrib/services.py +++ b/nova/api/openstack/compute/contrib/services.py @@ -21,6 +21,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 db from nova import exception from nova.openstack.common import cfg @@ -69,6 +70,7 @@ class ServiceController(object): authorize(context) now = timeutils.utcnow() services = db.service_get_all(context) + services = availability_zones.set_availability_zones(context, services) host = '' if 'host' in req.GET: diff --git a/nova/tests/api/openstack/compute/contrib/test_services.py b/nova/tests/api/openstack/compute/contrib/test_services.py index 12c1ef2a4..1bd47b67a 100644 --- a/nova/tests/api/openstack/compute/contrib/test_services.py +++ b/nova/tests/api/openstack/compute/contrib/test_services.py @@ -26,30 +26,30 @@ from nova.tests.api.openstack import fakes fake_services_list = [{'binary': 'nova-scheduler', 'host': 'host1', - 'availability_zone': 'nova', 'id': 1, 'disabled': True, + 'topic': 'scheduler', 'updated_at': datetime(2012, 10, 29, 13, 42, 2), 'created_at': datetime(2012, 9, 18, 2, 46, 27)}, {'binary': 'nova-compute', 'host': 'host1', - 'availability_zone': 'nova', 'id': 2, 'disabled': True, + 'topic': 'compute', 'updated_at': datetime(2012, 10, 29, 13, 42, 5), 'created_at': datetime(2012, 9, 18, 2, 46, 27)}, {'binary': 'nova-scheduler', 'host': 'host2', - 'availability_zone': 'nova', 'id': 3, 'disabled': False, + 'topic': 'scheduler', 'updated_at': datetime(2012, 9, 19, 6, 55, 34), 'created_at': datetime(2012, 9, 18, 2, 46, 28)}, {'binary': 'nova-compute', 'host': 'host2', - 'availability_zone': 'nova', 'id': 4, 'disabled': True, + 'topic': 'compute', 'updated_at': datetime(2012, 9, 18, 8, 3, 38), 'created_at': datetime(2012, 9, 18, 2, 46, 28)}, ] @@ -128,7 +128,7 @@ class ServicesTest(test.TestCase): res_dict = self.controller.index(req) response = {'services': [{'binary': 'nova-scheduler', - 'host': 'host1', 'zone': 'nova', + 'host': 'host1', 'zone': 'internal', 'status': 'disabled', 'state': 'up', 'updated_at': datetime(2012, 10, 29, 13, 42, 2)}, {'binary': 'nova-compute', @@ -136,7 +136,7 @@ class ServicesTest(test.TestCase): 'status': 'disabled', 'state': 'up', 'updated_at': datetime(2012, 10, 29, 13, 42, 5)}, {'binary': 'nova-scheduler', 'host': 'host2', - 'zone': 'nova', + 'zone': 'internal', 'status': 'enabled', 'state': 'down', 'updated_at': datetime(2012, 9, 19, 6, 55, 34)}, {'binary': 'nova-compute', 'host': 'host2', @@ -150,7 +150,7 @@ class ServicesTest(test.TestCase): res_dict = self.controller.index(req) response = {'services': [{'binary': 'nova-scheduler', 'host': 'host1', - 'zone': 'nova', + 'zone': 'internal', 'status': 'disabled', 'state': 'up', 'updated_at': datetime(2012, 10, 29, 13, 42, 2)}, {'binary': 'nova-compute', 'host': 'host1', |