From 636ec5eccda3f4caef90db3fe4e0c19df1bd348d Mon Sep 17 00:00:00 2001 From: Mike Perez Date: Sat, 2 Feb 2013 13:26:18 -0800 Subject: adding v2 support to cinderclient This will allow the cinderclient to speak to the v2 rest api if it's enabled in the cinder config. Includes additional v2 tests as well. blueprint cinderclient-v2-support Change-Id: I004134d9f528a6eadefdaa89eb48087bcae2691f --- cinderclient/shell.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cinderclient/shell.py') diff --git a/cinderclient/shell.py b/cinderclient/shell.py index 423db58..d6e5317 100644 --- a/cinderclient/shell.py +++ b/cinderclient/shell.py @@ -32,6 +32,7 @@ from cinderclient import exceptions as exc import cinderclient.extension from cinderclient import utils from cinderclient.v1 import shell as shell_v1 +from cinderclient.v2 import shell as shell_v2 DEFAULT_OS_VOLUME_API_VERSION = "1" DEFAULT_CINDER_ENDPOINT_TYPE = 'publicURL' @@ -162,7 +163,7 @@ class OpenStackCinderShell(object): metavar='', default=utils.env('OS_VOLUME_API_VERSION', default=DEFAULT_OS_VOLUME_API_VERSION), - help='Accepts 1,defaults ' + help='Accepts 1 or 2,defaults ' 'to env[OS_VOLUME_API_VERSION].') parser.add_argument('--os_volume_api_version', help=argparse.SUPPRESS) @@ -223,7 +224,7 @@ class OpenStackCinderShell(object): try: actions_module = { '1.1': shell_v1, - '2': shell_v1, + '2': shell_v2, }[version] except KeyError: actions_module = shell_v1 -- cgit v1.2.1