Remove SchedulerDependentManager

The update_service_capabilities method of this class has been unused
since it was disabled as a periodic task in commit
674ef05b0a.  The compute manager's update
to a v3 rpc api removed the last references to publishing capabilities,
so this can now be completely removed.

After removing the capabilities bits, the only value left in this class
was providing an instance of the scheduler rpcapi class.  This seemed
like overkill, so I removed this class completely and added the
scheduler rpcapi instance to the compute manager directly.

Related to blueprint rpc-major-version-updates-icehouse

Related to blueprint no-compute-fanout-to-scheduler

Change-Id: I72fd16fc96938a9ea9d509e24319a5273de900a9
This commit is contained in:
Russell Bryant
2013-11-01 17:06:34 -04:00
parent 4932904aaa
commit 27ce07f840
2 changed files with 3 additions and 26 deletions

View File

@@ -76,6 +76,7 @@ from nova.openstack.common.rpc import common as rpc_common
from nova.openstack.common import timeutils
from nova import paths
from nova import safe_utils
from nova.scheduler import rpcapi as scheduler_rpcapi
from nova import utils
from nova.virt import block_device as driver_block_device
from nova.virt import driver
@@ -416,7 +417,7 @@ class ComputeVirtAPI(virtapi.VirtAPI):
context, bdm_id, values)
class ComputeManager(manager.SchedulerDependentManager):
class ComputeManager(manager.Manager):
"""Manages the running instances from creation to destruction."""
RPC_API_VERSION = '3.0'
@@ -439,6 +440,7 @@ class ComputeManager(manager.SchedulerDependentManager):
openstack_driver.is_neutron_security_groups())
self.consoleauth_rpcapi = consoleauth.rpcapi.ConsoleAuthAPI()
self.cells_rpcapi = cells_rpcapi.CellsAPI()
self.scheduler_rpcapi = scheduler_rpcapi.SchedulerAPI()
self._resource_tracker_dict = {}
super(ComputeManager, self).__init__(service_name="compute",

View File

@@ -62,7 +62,6 @@ from nova.objects import base as objects_base
from nova.openstack.common import log as logging
from nova.openstack.common import periodic_task
from nova.openstack.common.rpc import dispatcher as rpc_dispatcher
from nova.scheduler import rpcapi as scheduler_rpcapi
CONF = cfg.CONF
@@ -128,27 +127,3 @@ class Manager(base.Base, periodic_task.PeriodicTasks):
Child classes should override this method.
"""
pass
class SchedulerDependentManager(Manager):
"""Periodically send capability updates to the Scheduler services.
Services that need to update the Scheduler of their capabilities
should derive from this class. Otherwise they can derive from
manager.Manager directly. Updates are only sent after
update_service_capabilities is called with non-None values.
"""
def __init__(self, host=None, db_driver=None, service_name='undefined'):
self.last_capabilities = None
self.service_name = service_name
self.scheduler_rpcapi = scheduler_rpcapi.SchedulerAPI()
super(SchedulerDependentManager, self).__init__(host, db_driver,
service_name)
def update_service_capabilities(self, capabilities):
"""Remember these capabilities to send on next periodic update."""
if not isinstance(capabilities, list):
capabilities = [capabilities]
self.last_capabilities = capabilities