summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorKevin L. Mitchell <kevin.mitchell@rackspace.com>2011-09-02 18:31:23 +0000
committerTarmac <>2011-09-02 18:31:23 +0000
commit3d542086f23b7b432fe776aed1498f9a7a6ebc7d (patch)
tree1233105f7a76b51648e10babe813618631e71ef9 /nova
parentd80dc5bbbd1781bd33d9f69b608014e9cc2e41a3 (diff)
parent666f7152910838f866ca4b76258b025c27744ffb (diff)
downloadnova-3d542086f23b7b432fe776aed1498f9a7a6ebc7d.tar.gz
nova-3d542086f23b7b432fe776aed1498f9a7a6ebc7d.tar.xz
nova-3d542086f23b7b432fe776aed1498f9a7a6ebc7d.zip
Fixes a small bug which causes filters to not work at all. Also reworks a bit of exception handling to allow the exception related to the bug to propagate up.
Diffstat (limited to 'nova')
-rw-r--r--nova/scheduler/host_filter.py6
-rw-r--r--nova/scheduler/manager.py10
2 files changed, 12 insertions, 4 deletions
diff --git a/nova/scheduler/host_filter.py b/nova/scheduler/host_filter.py
index 826a99b0a..9f7d34ea7 100644
--- a/nova/scheduler/host_filter.py
+++ b/nova/scheduler/host_filter.py
@@ -32,6 +32,12 @@ from nova import exception
from nova import flags
import nova.scheduler
+# NOTE(Vek): Even though we don't use filters in here anywhere, we
+# depend on default_host_filter being available in FLAGS,
+# and that happens only when filters/abstract_filter.py is
+# imported.
+from nova.scheduler import filters
+
FLAGS = flags.FLAGS
diff --git a/nova/scheduler/manager.py b/nova/scheduler/manager.py
index 0e395ee79..bf18abc6c 100644
--- a/nova/scheduler/manager.py
+++ b/nova/scheduler/manager.py
@@ -93,12 +93,14 @@ class SchedulerManager(manager.Manager):
driver_method = 'schedule_%s' % method
elevated = context.elevated()
try:
- host = getattr(self.driver, driver_method)(elevated, *args,
- **kwargs)
+ real_meth = getattr(self.driver, driver_method)
+ args = (elevated,) + args
except AttributeError, e:
LOG.warning(_("Driver Method %(driver_method)s missing: %(e)s."
- "Reverting to schedule()") % locals())
- host = self.driver.schedule(elevated, topic, *args, **kwargs)
+ "Reverting to schedule()") % locals())
+ real_meth = self.driver.schedule
+ args = (elevated, topic) + args
+ host = real_meth(*args, **kwargs)
if not host:
LOG.debug(_("%(topic)s %(method)s handled in Scheduler")