diff --git a/novaclient/shell.py b/novaclient/shell.py index 34e4317f2..c1fa1ecb4 100644 --- a/novaclient/shell.py +++ b/novaclient/shell.py @@ -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) diff --git a/tests/test_shell.py b/tests/test_shell.py index 54f36072b..ce7d76635 100644 --- a/tests/test_shell.py +++ b/tests/test_shell.py @@ -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()