From d48dc5d5af174535d5d96c2bbaee3d03715ed2b9 Mon Sep 17 00:00:00 2001 From: Bin Yang Date: Sat, 23 Sep 2017 01:20:11 +0800 Subject: Add backward support for identity v2.0 API Add NBI v2.0/tokens and convert to SBI v3/auth/tokens Change-Id: I5734e18f78844f15847b3a0a2d906b70e75fd260 Issue-Id: INT-225 Signed-off-by: Bin Yang --- ocata/ocata/extensions/urls.py | 6 ++---- ocata/ocata/proxy/urls.py | 4 +++- ocata/ocata/proxy/views/identityV3.py | 6 ++++++ 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'ocata') diff --git a/ocata/ocata/extensions/urls.py b/ocata/ocata/extensions/urls.py index 4dc46983..9aaf1331 100644 --- a/ocata/ocata/extensions/urls.py +++ b/ocata/ocata/extensions/urls.py @@ -19,10 +19,8 @@ from ocata.extensions.views import extensions from ocata.extensions.views import epacaps urlpatterns = [ - url(r'^sions$', extensions.Extensions.as_view()), - url(r'^sions/$', extensions.Extensions.as_view()), - url(r'^sions/epa-caps$', epacaps.EpaCaps.as_view()), - url(r'^sions/epa-caps/$', epacaps.EpaCaps.as_view()), + url(r'^sions/?$', extensions.Extensions.as_view()), + url(r'^sions/epa-caps/?$', epacaps.EpaCaps.as_view()), ] urlpatterns = format_suffix_patterns(urlpatterns) diff --git a/ocata/ocata/proxy/urls.py b/ocata/ocata/proxy/urls.py index 6f41d080..12777bf6 100644 --- a/ocata/ocata/proxy/urls.py +++ b/ocata/ocata/proxy/urls.py @@ -23,7 +23,9 @@ urlpatterns = [ # identityV2.Tokens.as_view()), url(r'^identity/v3/auth/tokens$', identityV3.Tokens.as_view()), - url(r'^identity/(?:v2.0/|)tenants$', + url(r'^identity/v2.0/tokens$', + identityV3.TokensV2.as_view()), + url(r'^identity/v2.0/tenants$', services.GetTenants.as_view()), url(r'^(?P[0-9a-zA-Z_-]{,18})/(?P[0-9a-zA-Z./_-]*)$', services.Services.as_view()), diff --git a/ocata/ocata/proxy/views/identityV3.py b/ocata/ocata/proxy/views/identityV3.py index 534ebe8f..ca9a2111 100644 --- a/ocata/ocata/proxy/views/identityV3.py +++ b/ocata/ocata/proxy/views/identityV3.py @@ -25,3 +25,9 @@ class Tokens(newton_identityV3.Tokens): def __init__(self): self.proxy_prefix = config.MULTICLOUD_PREFIX self._logger = logger + +class TokensV2(newton_identityV3.TokensV2): + + def __init__(self): + self.proxy_prefix = config.MULTICLOUD_PREFIX + self._logger = logger -- cgit 1.2.3-korg