Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge "Fix Multi_Scheduler to process host capabilities"

  • Loading branch information...
commit 75cd4642db7859085336dcfd47862cdedc858b88 2 parents 129795c + 3ae69eb
Jenkins authored openstack-gerrit committed
View
1  .mailmap
@@ -8,6 +8,7 @@
<anotherjesse@gmail.com> <jesse@aire.local>
<ant@openstack.org> <amesserl@rackspace.com>
<Armando.Migliaccio@eu.citrix.com> <armando.migliaccio@citrix.com>
+<Armando.Migliaccio@eu.citrix.com> <amigliaccio@internap.com>
<brian.elliott@rackspace.com> <bdelliott@gmail.com>
<brian.lamar@rackspace.com> <brian.lamar@gmail.com>
<brian.waldon@rackspace.com> <bcwaldon@gmail.com>
View
6 nova/scheduler/multi.py
@@ -81,3 +81,9 @@ def schedule_run_instance(self, *args, **kwargs):
def schedule_prep_resize(self, *args, **kwargs):
return self.drivers['compute'].schedule_prep_resize(*args, **kwargs)
+
+ def update_service_capabilities(self, service_name, host, capabilities):
+ # Multi scheduler is only a holder of sub-schedulers, so
+ # pass the capabilities to the schedulers that matter
+ for d in self.drivers.values():
+ d.update_service_capabilities(service_name, host, capabilities)
View
22 nova/tests/scheduler/test_multi_scheduler.py
@@ -28,6 +28,10 @@
class FakeComputeScheduler(driver.Scheduler):
is_fake_compute = True
+ def __init__(self):
+ super(FakeComputeScheduler, self).__init__()
+ self.is_update_caps_called = False
+
def schedule_theoretical(self, *args, **kwargs):
pass
@@ -38,6 +42,10 @@ def schedule(self, *args, **kwargs):
class FakeVolumeScheduler(driver.Scheduler):
is_fake_volume = True
+ def __init__(self):
+ super(FakeVolumeScheduler, self).__init__()
+ self.is_update_caps_called = False
+
def schedule_create_volume(self, *args, **kwargs):
pass
@@ -103,3 +111,17 @@ def test_schedule_fallback_proxy(self):
self.mox.ReplayAll()
mgr.schedule(ctxt, 'compute', method, *fake_args, **fake_kwargs)
mgr.schedule(ctxt, 'volume', method, *fake_args, **fake_kwargs)
+
+ def test_update_service_capabilities(self):
+ def fake_update_service_capabilities(self, service, host, caps):
+ self.is_update_caps_called = True
+
+ mgr = self._manager
+ self.stubs.Set(driver.Scheduler,
+ 'update_service_capabilities',
+ fake_update_service_capabilities)
+ self.assertFalse(mgr.drivers['compute'].is_update_caps_called)
+ self.assertFalse(mgr.drivers['volume'].is_update_caps_called)
+ mgr.update_service_capabilities('foo_svc', 'foo_host', 'foo_caps')
+ self.assertTrue(mgr.drivers['compute'].is_update_caps_called)
+ self.assertTrue(mgr.drivers['volume'].is_update_caps_called)
Please sign in to comment.
Something went wrong with that request. Please try again.