summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorMichael Still <mikal@stillhq.com>2012-03-15 15:04:37 +1100
committerMichael Still <mikal@stillhq.com>2012-03-16 17:22:30 +1100
commit7f64fa81414f9596c4327f1930f5568757fdecf0 (patch)
tree65af49c4fccb7d698e1f752af719ec8f677a5f83 /nova
parent30b8e35e80486b26eeb71bc62d92bae240cb72f2 (diff)
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
Diffstat (limited to 'nova')
-rw-r--r--nova/scheduler/host_manager.py13
1 files changed, 13 insertions, 0 deletions
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):