diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-06-25 20:14:25 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-06-25 20:14:25 +0000 |
commit | baec1694947b5da90f2524d7d5d397785a1ca7fa (patch) | |
tree | 48ae1631ea7f80df381cf5b49f0ae3403ffc5701 | |
parent | 9331c5c1115c7d8cc5bcab71b1100eeea1ce72fe (diff) | |
parent | 10db6128b8dc3ed2773acf262af529e0485cfe9f (diff) | |
download | nova-baec1694947b5da90f2524d7d5d397785a1ca7fa.tar.gz nova-baec1694947b5da90f2524d7d5d397785a1ca7fa.tar.xz nova-baec1694947b5da90f2524d7d5d397785a1ca7fa.zip |
Merge "Allow scheduler manager NoValidHost exception to pass over RPC"
-rw-r--r-- | nova/scheduler/manager.py | 1 | ||||
-rw-r--r-- | nova/tests/scheduler/test_scheduler.py | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/nova/scheduler/manager.py b/nova/scheduler/manager.py index 3d62ff9b0..2d63ee970 100644 --- a/nova/scheduler/manager.py +++ b/nova/scheduler/manager.py @@ -316,6 +316,7 @@ class SchedulerManager(manager.Manager): def get_backdoor_port(self, context): return self.backdoor_port + @rpc_common.client_exceptions(exception.NoValidHost) def select_hosts(self, context, request_spec, filter_properties): """Returns host(s) best suited for this request_spec and filter_properties. diff --git a/nova/tests/scheduler/test_scheduler.py b/nova/tests/scheduler/test_scheduler.py index 99de672c4..a15a97f90 100644 --- a/nova/tests/scheduler/test_scheduler.py +++ b/nova/tests/scheduler/test_scheduler.py @@ -408,6 +408,17 @@ class SchedulerManagerTestCase(test.NoDBTestCase): self.manager._set_vm_state_and_notify('foo', {'vm_state': 'foo'}, self.context, None, request) + def test_select_hosts_throws_rpc_clientexception(self): + self.mox.StubOutWithMock(self.manager.driver, 'select_hosts') + + self.manager.driver.select_hosts(self.context, {}, {}).AndRaise( + exception.NoValidHost(reason="")) + + self.mox.ReplayAll() + self.assertRaises(rpc_common.ClientException, + self.manager.select_hosts, + self.context, {}, {}) + class SchedulerTestCase(test.NoDBTestCase): """Test case for base scheduler driver class.""" |