Fix Multi_Scheduler to process host capabilities
To fix bug #1000403, make sure that each driver held by the Multi Scheduler gets called during update_service_capabilities. Change-Id: Iee8141f1a6dcfa24101640626d209d2d65776339
This commit is contained in:
parent
b4a64da192
commit
3ae69ebcc5
1
.mailmap
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>
|
||||
|
@ -81,3 +81,9 @@ class MultiScheduler(driver.Scheduler):
|
||||
|
||||
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)
|
||||
|
@ -28,6 +28,10 @@ from nova.tests.scheduler import test_scheduler
|
||||
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 @@ class FakeComputeScheduler(driver.Scheduler):
|
||||
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 @@ class MultiDriverTestCase(test_scheduler.SchedulerTestCase):
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user