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
This commit is contained in:
Russell Bryant
2012-09-18 17:01:34 -04:00
parent cd85087bb3
commit 0ac9f6d15c
2 changed files with 4 additions and 2 deletions

View File

@@ -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):

View File

@@ -95,4 +95,4 @@ class SchedulerRpcAPITestCase(test.TestCase):
self._test_scheduler_api('create_volume',
rpc_method='cast', volume_id="fake_volume",
snapshot_id="fake_snapshots", image_id="fake_image",
reservations=list('fake_res'))
reservations=list('fake_res'), version='2.1')