Remove version 1.1 support

v2 and v2.1 is supported now and it ask user to use v2.x API
should be what we wanted , this already deprecated for a
couple of release, so we can remove it now

Change-Id: I8de6fdbf21ccc4969297044a49590ffcd9cd27d8
This commit is contained in:
jichenjc 2017-03-25 20:06:43 +08:00
parent 9ca9ae6c10
commit 4c18c8bd97
4 changed files with 5 additions and 17 deletions

View File

@ -33,8 +33,6 @@ if not LOG.handlers:
LEGACY_HEADER_NAME = "X-OpenStack-Nova-API-Version"
HEADER_NAME = "OpenStack-API-Version"
SERVICE_TYPE = "compute"
# key is a deprecated version and value is an alternative version.
DEPRECATED_VERSIONS = {"1.1": "2"}
_SUBSTITUTIONS = {}
@ -232,13 +230,6 @@ def check_major_version(api_version):
def get_api_version(version_string):
"""Returns checked APIVersion object"""
version_string = str(version_string)
if version_string in DEPRECATED_VERSIONS:
LOG.warning(
_("Version %(deprecated_version)s is deprecated, using "
"alternative version %(alternative)s instead."),
{"deprecated_version": version_string,
"alternative": DEPRECATED_VERSIONS[version_string]})
version_string = DEPRECATED_VERSIONS[version_string]
if strutils.is_int_like(version_string):
version_string = "%s.0" % version_string

View File

@ -34,10 +34,6 @@ class ClientTest(utils.TestCase):
output = novaclient.client.get_client_class(2)
self.assertEqual(output, novaclient.v2.client.Client)
def test_get_client_class_v1_1(self):
output = novaclient.client.get_client_class('1.1')
self.assertEqual(output, novaclient.v2.client.Client)
def test_get_client_class_unknown(self):
self.assertRaises(novaclient.exceptions.UnsupportedVersion,
novaclient.client.get_client_class, '0')

View File

@ -608,10 +608,6 @@ class ShellTest(utils.TestCase):
def test_default_service_type(self, mock_client):
self._test_service_type(None, 'compute', mock_client)
@mock.patch('novaclient.client.Client')
def test_v1_1_service_type(self, mock_client):
self._test_service_type('1.1', 'compute', mock_client)
@mock.patch('novaclient.client.Client')
def test_v2_service_type(self, mock_client):
self._test_service_type('2', 'compute', mock_client)

View File

@ -0,0 +1,5 @@
---
upgrade:
- remove version 1.1 API support as we only support v2 and v2.1
API in nova side now.