Updated --version to default to NOVA_VERSION, quick fix.

This commit is contained in:
Brian Lamar 2011-08-04 10:55:08 -04:00
parent ea4b625e7b
commit 32fd202ab0
2 changed files with 7 additions and 5 deletions

View File

@ -86,10 +86,13 @@ class OpenStackComputeShell(object):
self.subcommands = {}
subparsers = parser.add_subparsers(metavar='<subcommand>')
actions_module = {
'1.0': shell_v1_0,
'1.1': shell_v1_1,
}[version]
try:
actions_module = {
'1.0': shell_v1_0,
'1.1': shell_v1_1,
}[version]
except KeyError:
actions_module = shell_v1_0
self._find_actions(subparsers, actions_module)
self._find_actions(subparsers, self)

View File

@ -17,7 +17,6 @@ class ShellTest(utils.TestCase):
'NOVA_USERNAME': 'username',
'NOVA_API_KEY': 'password',
'NOVA_PROJECT_ID': 'project_id',
'NOVA_VERSION': '1.0',
}
_old_env, os.environ = os.environ, fake_env.copy()