From 584dd87e6f16ef6b6cc94f90c9c8b006f6b14e7b Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Thu, 12 Jul 2012 16:08:14 -0400 Subject: [PATCH] Change base rpc version to 1.0 in compute rpcapi. A recent patch change the RPC_API_VERSION in compute/rpcapi.py to 1.1. This change was the right thing to do in compute/manager.py, but not compute/rpcapi.py. This patch changes it back to 1.0, and changes the code to only specify that 1.1 is required for the new method. This version in the rpcapi modules is used as the default version to set in a message. The version sent in a message is the minimum version required to be implemented on the manager side for the message to be successfully processed. For most messages, that is just 1.0. In the case of the new method, it's 1.1. This patch also changes the name of his variable in the rpcapi modules from RPC_API_VERSION to BASE_RPC_API_VERSION to help clarify this a bit more. Change-Id: I2bb4602845869bd44b39531eeb4f1e7c0c4c20c2 --- nova/scheduler/rpcapi.py | 4 ++-- nova/tests/scheduler/test_rpcapi.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nova/scheduler/rpcapi.py b/nova/scheduler/rpcapi.py index dea17b91..cdd3e648 100644 --- a/nova/scheduler/rpcapi.py +++ b/nova/scheduler/rpcapi.py @@ -33,11 +33,11 @@ class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy): 1.0 - Initial version. ''' - RPC_API_VERSION = '1.0' + BASE_RPC_API_VERSION = '1.0' def __init__(self): super(SchedulerAPI, self).__init__(topic=FLAGS.scheduler_topic, - default_version=self.RPC_API_VERSION) + default_version=self.BASE_RPC_API_VERSION) def run_instance(self, ctxt, topic, request_spec, admin_password, injected_files, requested_networks, is_first_time, diff --git a/nova/tests/scheduler/test_rpcapi.py b/nova/tests/scheduler/test_rpcapi.py index fed367c7..cfd16a08 100644 --- a/nova/tests/scheduler/test_rpcapi.py +++ b/nova/tests/scheduler/test_rpcapi.py @@ -41,7 +41,7 @@ class SchedulerRpcAPITestCase(test.TestCase): rpcapi = scheduler_rpcapi.SchedulerAPI() expected_retval = 'foo' if method == 'call' else None expected_msg = rpcapi.make_msg(method, **kwargs) - expected_msg['version'] = rpcapi.RPC_API_VERSION + expected_msg['version'] = rpcapi.BASE_RPC_API_VERSION if rpc_method == 'cast' and method == 'run_instance': kwargs['call'] = False