From 211dfe6ea706ec861daa3138d95b70c3427e0eed Mon Sep 17 00:00:00 2001 From: Ben Nemec Date: Tue, 6 Aug 2013 12:48:24 -0500 Subject: [PATCH] Enable v3 api code Add mappings to enable v3 code bp v3-api Change-Id: I035e5b9d65c06ce5691573832bb9b6c4c705b121 --- novaclient/client.py | 1 + novaclient/shell.py | 5 ++++- novaclient/v3/__init__.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/novaclient/client.py b/novaclient/client.py index ce0e8495e..03bdb030c 100644 --- a/novaclient/client.py +++ b/novaclient/client.py @@ -429,6 +429,7 @@ def get_client_class(version): version_map = { '1.1': 'novaclient.v1_1.client.Client', '2': 'novaclient.v1_1.client.Client', + '3': 'novaclient.v3.client.Client', } try: client_path = version_map[str(version)] diff --git a/novaclient/shell.py b/novaclient/shell.py index 7f3257155..8e7860879 100644 --- a/novaclient/shell.py +++ b/novaclient/shell.py @@ -56,6 +56,7 @@ import novaclient.extension from novaclient.openstack.common import strutils from novaclient import utils from novaclient.v1_1 import shell as shell_v1_1 +from novaclient.v3 import shell as shell_v3 DEFAULT_OS_COMPUTE_API_VERSION = "1.1" DEFAULT_NOVA_ENDPOINT_TYPE = 'publicURL' @@ -353,7 +354,8 @@ class OpenStackComputeShell(object): metavar='', default=utils.env('OS_COMPUTE_API_VERSION', default=DEFAULT_OS_COMPUTE_API_VERSION), - help='Accepts 1.1, defaults to env[OS_COMPUTE_API_VERSION].') + help='Accepts 1.1 or 3, ' + 'defaults to env[OS_COMPUTE_API_VERSION].') parser.add_argument('--os_compute_api_version', help=argparse.SUPPRESS) @@ -394,6 +396,7 @@ class OpenStackComputeShell(object): actions_module = { '1.1': shell_v1_1, '2': shell_v1_1, + '3': shell_v3, }[version] except KeyError: actions_module = shell_v1_1 diff --git a/novaclient/v3/__init__.py b/novaclient/v3/__init__.py index 19712285f..a442be109 100644 --- a/novaclient/v3/__init__.py +++ b/novaclient/v3/__init__.py @@ -14,4 +14,4 @@ # License for the specific language governing permissions and limitations # under the License. -from novaclient.v1_1.client import Client # noqa +from novaclient.v3.client import Client # noqa