From 0dbd2c5d3360a71658a146cb3947047e797a56f6 Mon Sep 17 00:00:00 2001 From: Chris Behrens Date: Mon, 14 Jan 2013 04:27:50 +0000 Subject: Cells: Add support for compute HostAPI() This will allow the hosts API extension to work. Calls to get service information from the DB are proxied via cells. When using the host extension, the 'id' and 'host' fields for service/compute will be modified to have the cell prepended to it. One can do a 'show' on a 'path!to!cell@id' to see details for a particular host in the 'path!to!cell' cell, for instance. Implements bp/nova-compute-cells Change-Id: I8137fa64d2578acfc3d2457c231de2b0d69b96d8 --- nova/api/openstack/compute/contrib/hosts.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/compute/contrib/hosts.py b/nova/api/openstack/compute/contrib/hosts.py index d1b39d6db..9ce278900 100644 --- a/nova/api/openstack/compute/contrib/hosts.py +++ b/nova/api/openstack/compute/contrib/hosts.py @@ -124,11 +124,12 @@ class HostController(object): """ context = req.environ['nova.context'] authorize(context) - filters = {} + filters = {'disabled': False} zone = req.GET.get('zone', None) if zone: filters['availability_zone'] = zone - services = self.api.service_get_all(context, filters=filters) + services = self.api.service_get_all(context, filters=filters, + set_zones=True) hosts = [] for service in services: hosts.append({'host_name': service['host'], -- cgit