summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-06-20 19:37:42 +0000
committerGerrit Code Review <review@openstack.org>2012-06-20 19:37:42 +0000
commit5226d4054cb2b25bca9a00636663cd56d4f1ddb5 (patch)
tree00722fe4864646d7579ff6df0303b271e83e7c4e /nova/api
parentba3754e3ff672a877d90c78486c7f4d5fd4bf7b0 (diff)
parent2c0adf1304e73eb1c940a6fbfd50bf34f870e282 (diff)
downloadnova-5226d4054cb2b25bca9a00636663cd56d4f1ddb5.tar.gz
nova-5226d4054cb2b25bca9a00636663cd56d4f1ddb5.tar.xz
nova-5226d4054cb2b25bca9a00636663cd56d4f1ddb5.zip
Merge "Fix bug 1014925: fix os-hosts"
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/contrib/hosts.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/nova/api/openstack/compute/contrib/hosts.py b/nova/api/openstack/compute/contrib/hosts.py
index 6cdca56c8..e24ef3605 100644
--- a/nova/api/openstack/compute/contrib/hosts.py
+++ b/nova/api/openstack/compute/contrib/hosts.py
@@ -27,7 +27,6 @@ from nova import db
from nova import exception
from nova import flags
from nova import log as logging
-from nova.scheduler import rpcapi as scheduler_rpcapi
LOG = logging.getLogger(__name__)
@@ -98,8 +97,11 @@ def _list_hosts(req, service=None):
by service type.
"""
context = req.environ['nova.context']
- rpcapi = scheduler_rpcapi.SchedulerAPI()
- hosts = rpcapi.get_host_list(context)
+ services = db.service_get_all(context, False)
+
+ hosts = []
+ for host in services:
+ hosts.append({"host_name": host['host'], 'service': host['topic']})
if service:
hosts = [host for host in hosts
if host["service"] == service]