diff options
| author | Joe Gordon <jogo@cloudscaling.com> | 2012-06-19 02:27:53 +0000 |
|---|---|---|
| committer | Joe Gordon <jogo@cloudscaling.com> | 2012-06-19 11:07:35 -0700 |
| commit | 2c0adf1304e73eb1c940a6fbfd50bf34f870e282 (patch) | |
| tree | 576fdaf2effa3ed9f1ce80d63b4ec763619a19d5 /nova/api | |
| parent | eae762ad2ea6bde52231d5fffc58ed2ad932758d (diff) | |
| download | nova-2c0adf1304e73eb1c940a6fbfd50bf34f870e282.tar.gz nova-2c0adf1304e73eb1c940a6fbfd50bf34f870e282.tar.xz nova-2c0adf1304e73eb1c940a6fbfd50bf34f870e282.zip | |
Fix bug 1014925: fix os-hosts
List all hosts API.
Change-Id: I95231ac98223c7b8cc07e867283da8c8d90fed38
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/hosts.py | 8 |
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] |
