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
This commit is contained in:
@@ -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,
|
||||
|
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user