fix rpcapi version.

In commit ce4dbbd7, the BASE_RPC_API_VERSION was changed to '2.1' in
nova.compute.rpcapi.  This should remain '2.0' until the API goes to
3.X.  Only specify version '2.1' for the method that requires it
(rebuild_instance).

Add a NOTE above each instance of BASE_RPC_API_VERSION to try to help
clarify this for the future.

Change-Id: I06cef44c905e8966505d5fb5b1046d6a0c75d533
This commit is contained in:
Russell Bryant
2012-09-11 13:17:04 -04:00
parent 93c7652199
commit 5465d13b13
6 changed files with 53 additions and 4 deletions

View File

@@ -33,6 +33,14 @@ class CertAPI(nova.openstack.common.rpc.proxy.RpcProxy):
1.0 - Initial version.
'''
#
# NOTE(russellb): This is the default minimum version that the server
# (manager) side must implement unless otherwise specified using a version
# argument to self.call()/cast()/etc. here. It should be left as X.0 where
# X is the current major API version (1.0, 2.0, ...). For more information
# about rpc API versioning, see the docs in
# openstack/common/rpc/dispatcher.py.
#
BASE_RPC_API_VERSION = '1.0'
def __init__(self):

View File

@@ -127,10 +127,18 @@ class ComputeAPI(nova.openstack.common.rpc.proxy.RpcProxy):
1.44 - Adds reserve_block_device_name()
2.0 - Remove 1.x backwards compat
2.1 - Adds orig_sys_metadata to rebuild()
2.1 - Adds orig_sys_metadata to rebuild_instance()
'''
BASE_RPC_API_VERSION = '2.1'
#
# NOTE(russellb): This is the default minimum version that the server
# (manager) side must implement unless otherwise specified using a version
# argument to self.call()/cast()/etc. here. It should be left as X.0 where
# X is the current major API version (1.0, 2.0, ...). For more information
# about rpc API versioning, see the docs in
# openstack/common/rpc/dispatcher.py.
#
BASE_RPC_API_VERSION = '2.0'
def __init__(self):
super(ComputeAPI, self).__init__(
@@ -340,7 +348,8 @@ class ComputeAPI(nova.openstack.common.rpc.proxy.RpcProxy):
injected_files=injected_files, image_ref=image_ref,
orig_image_ref=orig_image_ref,
orig_sys_metadata=orig_sys_metadata),
topic=_compute_topic(self.topic, ctxt, None, instance))
topic=_compute_topic(self.topic, ctxt, None, instance),
version='2.1')
def refresh_provider_fw_rules(self, ctxt, host):
self.cast(ctxt, self.make_msg('refresh_provider_fw_rules'),
@@ -503,6 +512,14 @@ class SecurityGroupAPI(nova.openstack.common.rpc.proxy.RpcProxy):
2.0 - Remove 1.x backwards compat
'''
#
# NOTE(russellb): This is the default minimum version that the server
# (manager) side must implement unless otherwise specified using a version
# argument to self.call()/cast()/etc. here. It should be left as X.0 where
# X is the current major API version (1.0, 2.0, ...). For more information
# about rpc API versioning, see the docs in
# openstack/common/rpc/dispatcher.py.
#
BASE_RPC_API_VERSION = '2.0'
def __init__(self):

View File

@@ -33,6 +33,14 @@ class ConsoleAPI(nova.openstack.common.rpc.proxy.RpcProxy):
1.0 - Initial version.
'''
#
# NOTE(russellb): This is the default minimum version that the server
# (manager) side must implement unless otherwise specified using a version
# argument to self.call()/cast()/etc. here. It should be left as X.0 where
# X is the current major API version (1.0, 2.0, ...). For more information
# about rpc API versioning, see the docs in
# openstack/common/rpc/dispatcher.py.
#
BASE_RPC_API_VERSION = '1.0'
def __init__(self, topic=None):

View File

@@ -33,6 +33,14 @@ class ConsoleAuthAPI(nova.openstack.common.rpc.proxy.RpcProxy):
1.0 - Initial version.
'''
#
# NOTE(russellb): This is the default minimum version that the server
# (manager) side must implement unless otherwise specified using a version
# argument to self.call()/cast()/etc. here. It should be left as X.0 where
# X is the current major API version (1.0, 2.0, ...). For more information
# about rpc API versioning, see the docs in
# openstack/common/rpc/dispatcher.py.
#
BASE_RPC_API_VERSION = '1.0'
def __init__(self):

View File

@@ -46,6 +46,14 @@ class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy):
2.0 - Remove 1.x backwards compat
'''
#
# NOTE(russellb): This is the default minimum version that the server
# (manager) side must implement unless otherwise specified using a version
# argument to self.call()/cast()/etc. here. It should be left as X.0 where
# X is the current major API version (1.0, 2.0, ...). For more information
# about rpc API versioning, see the docs in
# openstack/common/rpc/dispatcher.py.
#
BASE_RPC_API_VERSION = '2.0'
def __init__(self):

View File

@@ -227,7 +227,7 @@ class ComputeRpcAPITestCase(test.TestCase):
instance=self.fake_instance, new_pass='pass',
injected_files='files', image_ref='ref',
orig_image_ref='orig_ref',
orig_sys_metadata='orig_sys_metadata')
orig_sys_metadata='orig_sys_metadata', version='2.1')
def test_reserve_block_device_name(self):
self._test_compute_api('reserve_block_device_name', 'call',