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
This commit is contained in:
Dean Troyer
2014-11-14 17:27:58 -06:00
parent f5a2811b65
commit 2b02beaa51
5 changed files with 13 additions and 9 deletions
openstackclient
setup.cfg

@ -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(