summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2012-07-27 08:42:30 -0400
committerRussell Bryant <rbryant@redhat.com>2012-07-31 14:18:39 -0400
commitcf1540c4a62f0a31c4a313be3811d1e4b81091f8 (patch)
tree45f92d13af9fb301cd4c7a00e38a20b566c48027
parent8605f34a31883c97d9385b3c8c5c5120bae52433 (diff)
downloadnova-cf1540c4a62f0a31c4a313be3811d1e4b81091f8.tar.gz
nova-cf1540c4a62f0a31c4a313be3811d1e4b81091f8.tar.xz
nova-cf1540c4a62f0a31c4a313be3811d1e4b81091f8.zip
Partially revert "Remove unused scheduler functions"
This partially reverts commit 2aaa3d2860eed7574c5df64a8ceeb8a6adf23460. The problem pointed out by this bug is that these changes introduce a non-backwards compatibile change to the schedulre rpc API. There are a couple of acceptable ways to deal with this: 1) Leave most of the code and only remove the client side. This means that a message sent from an earlier version will still work. This is the ideal situation for almost *all* changes to rpc APIs. We have to make a habit of this to eventually be able to support rolling upgrades. 2) Leave the manager methods, but simply have them raise an exception. This is a bit better than removing the method because the error can be made more explicit and obvious. Otherwise, the operator will get "no such method" rpc exceptions, which will seem a bit more bizzare. An example of when this option makes sense is commit cac332c39645286a11c009094a86f62d02752183. This patch refactored the live migration code is such a significant way that making it backwards compatibile seemed rather difficult to do. The old rpc methods stuck around but just raise an exception. The potential failure is just that live migration would fail, but the exception makes it obvious that an upgrade must be completed for live migration to work. The current patch implements #2 in the case of get_service_capabilities, since it hasn't been used since pre-essex. Approach #2 is taken for get_host_list() as well. It was used until fairly recently, but was broken, including being broken in Essex. The fix that went into Essex for this makes it no longer use RPC. Fix bug 1029262. Change-Id: I74c7d2a3e88b3a4f114e7da62c56f0481ee64a64
-rw-r--r--nova/scheduler/manager.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/nova/scheduler/manager.py b/nova/scheduler/manager.py
index 2a096cce8..e243e4518 100644
--- a/nova/scheduler/manager.py
+++ b/nova/scheduler/manager.py
@@ -34,6 +34,7 @@ from nova.openstack.common import excutils
from nova.openstack.common import importutils
from nova.openstack.common import log as logging
from nova.openstack.common.notifier import api as notifier
+from nova.openstack.common.rpc import common as rpc_common
from nova import quota
@@ -67,6 +68,21 @@ class SchedulerManager(manager.Manager):
# the rpc API as well, and the version should be updated accordingly.
return functools.partial(self._schedule, key)
+ def get_host_list(self, context):
+ """Get a list of hosts from the HostManager.
+
+ Currently unused, but left for backwards compatibility.
+ """
+ raise rpc_common.RPCException(message=_('Deprecated in version 1.0'))
+
+ def get_service_capabilities(self, context):
+ """Get the normalized set of capabilities for this zone.
+
+ Has been unused since pre-essex, but remains for rpc API 1.X
+ completeness.
+ """
+ raise rpc_common.RPCException(message=_('Deprecated in version 1.0'))
+
def update_service_capabilities(self, context, service_name=None,
host=None, capabilities=None, **kwargs):
"""Process a capability update from a service node."""