From 04caf88307235afd6cb34cd369cc4ef983665457 Mon Sep 17 00:00:00 2001 From: Ivan Kolodyazhny Date: Mon, 12 Jan 2015 18:05:04 +0200 Subject: [PATCH] Set default OS_VOLUME_API_VERSION to '2' Cinder API v1.1 is deprecated and will be removed. Switching to API v2 in cinderclient makes it works well with new API after API v1 will be removed. Change-Id: I639f4b54dc7e220e8e351113a4de1dff104b50a7 --- cinderclient/shell.py | 2 +- cinderclient/tests/unit/test_auth_plugins.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cinderclient/shell.py b/cinderclient/shell.py index a33c8d867..3b395f0ef 100644 --- a/cinderclient/shell.py +++ b/cinderclient/shell.py @@ -52,7 +52,7 @@ import six.moves.urllib.parse as urlparse osprofiler_profiler = importutils.try_import("osprofiler.profiler") -DEFAULT_OS_VOLUME_API_VERSION = "1" +DEFAULT_OS_VOLUME_API_VERSION = "2" DEFAULT_CINDER_ENDPOINT_TYPE = 'publicURL' DEFAULT_CINDER_SERVICE_TYPE = 'volume' diff --git a/cinderclient/tests/unit/test_auth_plugins.py b/cinderclient/tests/unit/test_auth_plugins.py index a16981456..7eabe1dd8 100644 --- a/cinderclient/tests/unit/test_auth_plugins.py +++ b/cinderclient/tests/unit/test_auth_plugins.py @@ -53,6 +53,17 @@ def mock_http_request(resp=None): }, ], }, + { + "type": "volumev2", + "endpoints": [ + { + "region": "RegionOne", + "adminURL": "http://localhost:8774/v2", + "internalURL": "http://localhost:8774/v2", + "publicURL": "http://localhost:8774/v2/", + }, + ], + }, ], }, }