summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2015-11-09 09:29:38 -0500
committerMonty Taylor <mordred@inaugust.com>2015-11-09 09:31:37 -0500
commit441543d67fbff068c1993a39c72c8dd62df34cfb (patch)
tree537ede296fb1239738ddb9358dad5ba6413d70b0
parenta337f664d23cea334be4618a0049a9f124df777c (diff)
downloadpython-openstackclient-441543d67fbff068c1993a39c72c8dd62df34cfb.tar.gz
Set default network api to 2.0 instead of 2
neutronclient expects 2.0 as the version if you go through the discovery constructor. For that reason, 2.0 is the 'correct' version to set in config files or environment variables for if you're using things that are not OSC. However, if you do that, OSC prints a warning that 2.0 is not in the supported network version list. Let's support both so that users don't get a confuse. Change-Id: I7412519693f75fcd29f5621ce9e5a2df2da92684
-rw-r--r--openstackclient/network/client.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/openstackclient/network/client.py b/openstackclient/network/client.py
index 5f72782b..69ed11fe 100644
--- a/openstackclient/network/client.py
+++ b/openstackclient/network/client.py
@@ -18,10 +18,11 @@ from openstackclient.common import utils
LOG = logging.getLogger(__name__)
-DEFAULT_API_VERSION = '2'
+DEFAULT_API_VERSION = '2.0'
API_VERSION_OPTION = 'os_network_api_version'
API_NAME = "network"
API_VERSIONS = {
+ "2.0": "neutronclient.v2_0.client.Client",
"2": "neutronclient.v2_0.client.Client",
}
# Translate our API version to auth plugin version prefix
@@ -32,6 +33,7 @@ API_VERSION_MAP = {
NETWORK_API_TYPE = 'network'
NETWORK_API_VERSIONS = {
+ '2.0': 'openstackclient.api.network_v2.APIv2',
'2': 'openstackclient.api.network_v2.APIv2',
}