From 7f64fa81414f9596c4327f1930f5568757fdecf0 Mon Sep 17 00:00:00 2001 From: Michael Still Date: Thu, 15 Mar 2012 15:04:37 +1100 Subject: Debug messages for host filters. This will help people work out why they have NoValidHosts when things go wrong. Resolves bug 955650 Change-Id: I042937351010e85648cbc1aa0f029dbb5a402eb7 --- nova/scheduler/host_manager.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'nova') diff --git a/nova/scheduler/host_manager.py b/nova/scheduler/host_manager.py index 0f8e09c64..f5ba724d5 100644 --- a/nova/scheduler/host_manager.py +++ b/nova/scheduler/host_manager.py @@ -141,13 +141,26 @@ class HostState(object): """Return whether or not this host passes filters.""" if self.host in filter_properties.get('ignore_hosts', []): + LOG.debug(_('Host filter fails for ignored host %(host)s'), + {'host': self.host}) return False + force_hosts = filter_properties.get('force_hosts', []) if force_hosts: + if not self.host in force_hosts: + LOG.debug(_('Host filter fails for non-forced host %(host)s'), + {'host': self.host}) return self.host in force_hosts + for filter_fn in filter_fns: if not filter_fn(self, filter_properties): + LOG.debug(_('Host filter function %(func)s failed for ' + '%(host)s'), + {'func': repr(filter_fn), + 'host': self.host}) return False + + LOG.debug(_('Host filter passes for %(host)s'), {'host': self.host}) return True def __repr__(self): -- cgit