summaryrefslogtreecommitdiff
path: root/novaclient/shell.py
diff options
context:
space:
mode:
Diffstat (limited to 'novaclient/shell.py')
-rw-r--r--novaclient/shell.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/novaclient/shell.py b/novaclient/shell.py
index 0cc6b43..940a01e 100644
--- a/novaclient/shell.py
+++ b/novaclient/shell.py
@@ -55,9 +55,9 @@ import novaclient.extension
55from novaclient.i18n import _ 55from novaclient.i18n import _
56from novaclient.openstack.common import cliutils 56from novaclient.openstack.common import cliutils
57from novaclient import utils 57from novaclient import utils
58from novaclient.v1_1 import shell as shell_v1_1 58from novaclient.v2 import shell as shell_v2
59 59
60DEFAULT_OS_COMPUTE_API_VERSION = "1.1" 60DEFAULT_OS_COMPUTE_API_VERSION = "2"
61DEFAULT_NOVA_ENDPOINT_TYPE = 'publicURL' 61DEFAULT_NOVA_ENDPOINT_TYPE = 'publicURL'
62# NOTE(cyeoh): Having the service type dependent on the API version 62# NOTE(cyeoh): Having the service type dependent on the API version
63# is pretty ugly, but we have to do this because traditionally the 63# is pretty ugly, but we have to do this because traditionally the
@@ -446,12 +446,12 @@ class OpenStackComputeShell(object):
446 446
447 try: 447 try:
448 actions_module = { 448 actions_module = {
449 '1.1': shell_v1_1, 449 '1.1': shell_v2,
450 '2': shell_v1_1, 450 '2': shell_v2,
451 '3': shell_v1_1, 451 '3': shell_v2,
452 }[version] 452 }[version]
453 except KeyError: 453 except KeyError:
454 actions_module = shell_v1_1 454 actions_module = shell_v2
455 455
456 self._find_actions(subparsers, actions_module) 456 self._find_actions(subparsers, actions_module)
457 self._find_actions(subparsers, self) 457 self._find_actions(subparsers, self)
@@ -491,6 +491,10 @@ class OpenStackComputeShell(object):
491 def _discover_via_contrib_path(self, version): 491 def _discover_via_contrib_path(self, version):
492 module_path = os.path.dirname(os.path.abspath(__file__)) 492 module_path = os.path.dirname(os.path.abspath(__file__))
493 version_str = "v%s" % version.replace('.', '_') 493 version_str = "v%s" % version.replace('.', '_')
494 # NOTE(akurilin): v1.1, v2 and v3 have one implementation, so
495 # we should discover contrib modules in one place.
496 if version_str in ["v1_1", "v3"]:
497 version_str = "v2"
494 ext_path = os.path.join(module_path, version_str, 'contrib') 498 ext_path = os.path.join(module_path, version_str, 'contrib')
495 ext_glob = os.path.join(ext_path, "*.py") 499 ext_glob = os.path.join(ext_path, "*.py")
496 500