From 2b02beaa5182e678d9da00402a7c4f137710f813 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Fri, 14 Nov 2014 17:27:58 -0600 Subject: Liberalize version matching a bit For class-loading purposes we can just use the major version, so accept that. Only Identity and Compute were affected; Compute is included just to be pedantically complete. For command groups we also just use the major version so fix Compute and the version option handling. Change the internal default for Identity to a simple '2' so it is also consistent with the rest of the world. Then comes microversioning... Closes-Bug: #1292638 Change-Id: Ibaf823b31caa288a83de38d2c258860b128b87d8 --- openstackclient/shell.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'openstackclient/shell.py') diff --git a/openstackclient/shell.py b/openstackclient/shell.py index 1198bae1..ac5556af 100644 --- a/openstackclient/shell.py +++ b/openstackclient/shell.py @@ -255,7 +255,8 @@ class OpenStackShell(app.App): if version_opt: api = mod.API_NAME self.api_version[api] = version_opt - version = '.v' + version_opt.replace('.', '_') + # Command groups deal only with major versions + version = '.v' + version_opt.replace('.', '_').split('_')[0] cmd_group = 'openstack.' + api.replace('-', '_') + version self.command_manager.add_command_group(cmd_group) self.log.debug( -- cgit v1.2.1