summaryrefslogtreecommitdiffstats
path: root/nova/scheduler
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2012-09-18 17:01:34 -0400
committerRussell Bryant <rbryant@redhat.com>2012-09-18 17:29:16 -0400
commitfe916c95cfdaf4aeb1fdbfd57421b7d1222e7d4b (patch)
treeff2f560f3b3712059b6f181dcb0ba148ca405ec3 /nova/scheduler
parent1b1fae700dc86870f5dfb81e668f02ab7b2c2929 (diff)
downloadnova-fe916c95cfdaf4aeb1fdbfd57421b7d1222e7d4b.tar.gz
nova-fe916c95cfdaf4aeb1fdbfd57421b7d1222e7d4b.tar.xz
nova-fe916c95cfdaf4aeb1fdbfd57421b7d1222e7d4b.zip
Update scheduler rpc API version.
Commit de09c1866b9138610914ddaaebb9b030884d1e28 updated the scheduler rpc API but did not account for rpc API versioning. This patch fixes it up. It updates the manager to reflect that it implements '2.1' and is now backwards compatible with the old method signature. The client side rpcapi now indicates that it requires '2.1' when sending the new image_id argument. Fix bug 1052670. Change-Id: Ide541f38d3d0129809da56baffe95bc3faab0569
Diffstat (limited to 'nova/scheduler')
-rw-r--r--nova/scheduler/manager.py6
-rw-r--r--nova/scheduler/rpcapi.py4
2 files changed, 6 insertions, 4 deletions
diff --git a/nova/scheduler/manager.py b/nova/scheduler/manager.py
index 647c2c780..377cdaaa2 100644
--- a/nova/scheduler/manager.py
+++ b/nova/scheduler/manager.py
@@ -53,7 +53,7 @@ QUOTAS = quota.QUOTAS
class SchedulerManager(manager.Manager):
"""Chooses a host to run instances on."""
- RPC_API_VERSION = '2.0'
+ RPC_API_VERSION = '2.1'
def __init__(self, scheduler_driver=None, *args, **kwargs):
if not scheduler_driver:
@@ -69,8 +69,8 @@ class SchedulerManager(manager.Manager):
self.driver.update_service_capabilities(service_name, host,
capabilities)
- def create_volume(self, context, volume_id, snapshot_id, image_id,
- reservations):
+ def create_volume(self, context, volume_id, snapshot_id,
+ reservations, image_id=None):
try:
self.driver.schedule_create_volume(
context, volume_id, snapshot_id, image_id, reservations)
diff --git a/nova/scheduler/rpcapi.py b/nova/scheduler/rpcapi.py
index 894131179..f36578dab 100644
--- a/nova/scheduler/rpcapi.py
+++ b/nova/scheduler/rpcapi.py
@@ -44,6 +44,7 @@ class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy):
1.7 - Add create_volume() method, remove topic from live_migration()
2.0 - Remove 1.x backwards compat
+ 2.1 - Add image_id to create_volume()
'''
#
@@ -98,7 +99,8 @@ class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy):
self.cast(ctxt,
self.make_msg('create_volume',
volume_id=volume_id, snapshot_id=snapshot_id,
- image_id=image_id, reservations=reservations))
+ image_id=image_id, reservations=reservations),
+ version='2.1')
def update_service_capabilities(self, ctxt, service_name, host,
capabilities):