revert deprecation of v2 API

For more info, see the openstack-dev mailing list:

    http://lists.openstack.org/pipermail/openstack-dev/2014-March/031016.html

Related Blueprint:

    https://blueprints.launchpad.net/keystone/+spec/deprecate-v2-api

Change-Id: Ic160da00f1c2fbcf0589b3e1c6c93f53a4e67b72
This commit is contained in:
Dolph Mathews 2014-03-25 19:54:01 -05:00
parent e45ff9e0da
commit 17e77f9e32
4 changed files with 21 additions and 11 deletions

View File

@ -24,15 +24,28 @@ from keystone import config
from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.openstack.common import log
from keystone.openstack.common import versionutils
LOG = log.getLogger(__name__)
CONF = config.CONF
v2_deprecated = versionutils.deprecated(what='v2 API',
as_of=versionutils.deprecated.ICEHOUSE,
in_favor_of='v3 API')
def v2_deprecated(f):
"""No-op decorator in preparation for deprecating Identity API v2.
This is a placeholder for the pending deprecation of v2. The implementation
of this decorator can be replaced with::
from keystone.openstack.common import versionutils
v2_deprecated = versionutils.deprecated(
what='v2 API',
as_of=versionutils.deprecated.JUNO,
in_favor_of='v3 API')
"""
return f
def _build_policy_check_credentials(self, action, context, kwargs):

View File

@ -326,10 +326,7 @@ class XmlSerializer(object):
# NOTE(blk-u): For compatibility with Folsom, when serializing the
# v2.0 version element also add the links to the base element.
if (value.get('id') == 'v2.0' and
value.get('status') == 'deprecated' and
value.get('updated') == '2014-04-17T00:00:00Z'):
if value.get('id') == 'v2.0':
for item in value['links']:
child = etree.Element('link')
self.populate_element(child, item)

View File

@ -80,7 +80,7 @@ class Version(wsgi.Application):
if 'v2.0' in _VERSIONS:
versions['v2.0'] = {
'id': 'v2.0',
'status': 'deprecated',
'status': 'stable',
'updated': '2014-04-17T00:00:00Z',
'links': [
{

View File

@ -55,7 +55,7 @@ v2_PDF_DESCRIPTION = {
v2_EXPECTED_RESPONSE = {
"id": "v2.0",
"status": "deprecated",
"status": "stable",
"updated": "2014-04-17T00:00:00Z",
"links": [
{
@ -318,7 +318,7 @@ class XmlVersionTestCase(tests.TestCase):
XML_NAMESPACE_V3 = 'xmlns="http://docs.openstack.org/identity/api/v3"'
v2_VERSION_DATA = """
<version %(v2_namespace)s status="deprecated" updated="2014-04-17T00:00:00Z"
<version %(v2_namespace)s status="stable" updated="2014-04-17T00:00:00Z"
id="v2.0">
<media-types>
<media-type base="application/json" type="application/\