def _list_hosts(req, service=None): """Returns a summary list of hosts, optionally filtering by service type. """ context = req.environ["nova.context"] hosts = scheduler_api.get_host_list(context) if service: hosts = [host for host in hosts if host["service"] == service] return hosts
def _list_hosts(req, service=None): """Returns a summary list of hosts, optionally filtering by service type. """ context = req.environ['nova.context'] hosts = scheduler_api.get_host_list(context) if service: hosts = [host for host in hosts if host["service"] == service] return hosts