diff options
Diffstat (limited to 'nova/console')
| -rw-r--r-- | nova/console/rpcapi.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/nova/console/rpcapi.py b/nova/console/rpcapi.py index 86debae32..7a78b52c2 100644 --- a/nova/console/rpcapi.py +++ b/nova/console/rpcapi.py @@ -31,6 +31,11 @@ rpcapi_opts = [ CONF = cfg.CONF CONF.register_opts(rpcapi_opts) +rpcapi_cap_opt = cfg.StrOpt('console', + default=None, + help='Set a version cap for messages sent to console services') +CONF.register_opt(rpcapi_cap_opt, 'upgrade_levels') + class ConsoleAPI(nova.openstack.common.rpc.proxy.RpcProxy): '''Client side of the console rpc API. @@ -39,6 +44,10 @@ class ConsoleAPI(nova.openstack.common.rpc.proxy.RpcProxy): 1.0 - Initial version. 1.1 - Added get_backdoor_port() + + ... Grizzly supports message version 1.1. So, any changes to existing + methods in 2.x after that point should be done such that they can + handle the version_cap being set to 1.1. ''' # @@ -51,11 +60,18 @@ class ConsoleAPI(nova.openstack.common.rpc.proxy.RpcProxy): # BASE_RPC_API_VERSION = '1.0' + VERSION_ALIASES = { + 'grizzly': '1.1', + } + def __init__(self, topic=None): topic = topic if topic else CONF.console_topic + version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.console, + CONF.upgrade_levels.console) super(ConsoleAPI, self).__init__( topic=topic, - default_version=self.BASE_RPC_API_VERSION) + default_version=self.BASE_RPC_API_VERSION, + version_cap=version_cap) def add_console(self, ctxt, instance_id): self.cast(ctxt, self.make_msg('add_console', instance_id=instance_id)) |
