diff options
Diffstat (limited to 'nova/consoleauth')
| -rw-r--r-- | nova/consoleauth/rpcapi.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/nova/consoleauth/rpcapi.py b/nova/consoleauth/rpcapi.py index 62aeab8da..ffc1a3de4 100644 --- a/nova/consoleauth/rpcapi.py +++ b/nova/consoleauth/rpcapi.py @@ -24,6 +24,11 @@ import nova.openstack.common.rpc.proxy CONF = cfg.CONF +rpcapi_cap_opt = cfg.StrOpt('consoleauth', + default=None, + help='Set a version cap for messages sent to consoleauth services') +CONF.register_opt(rpcapi_cap_opt, 'upgrade_levels') + class ConsoleAuthAPI(nova.openstack.common.rpc.proxy.RpcProxy): '''Client side of the consoleauth rpc API. @@ -34,6 +39,10 @@ class ConsoleAuthAPI(nova.openstack.common.rpc.proxy.RpcProxy): 1.1 - Added get_backdoor_port() 1.2 - Added instance_uuid to authorize_console, and delete_tokens_for_instance + + ... Grizzly supports message version 1.2. 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.2. ''' # @@ -46,10 +55,17 @@ class ConsoleAuthAPI(nova.openstack.common.rpc.proxy.RpcProxy): # BASE_RPC_API_VERSION = '1.0' + VERSION_ALIASES = { + 'grizzly': '1.2', + } + def __init__(self): + version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.consoleauth, + CONF.upgrade_levels.consoleauth) super(ConsoleAuthAPI, self).__init__( topic=CONF.consoleauth_topic, - default_version=self.BASE_RPC_API_VERSION) + default_version=self.BASE_RPC_API_VERSION, + version_cap=version_cap) def authorize_console(self, ctxt, token, console_type, host, port, internal_access_path, instance_uuid=None): |
