diff options
author | Bin Yang <bin.yang@windriver.com> | 2017-09-23 01:20:11 +0800 |
---|---|---|
committer | Bin Yang <bin.yang@windriver.com> | 2017-09-23 01:21:52 +0800 |
commit | d48dc5d5af174535d5d96c2bbaee3d03715ed2b9 (patch) | |
tree | c5a1cfc07fc8d5df4cfe52aeb5d0ea4e4896333f /ocata | |
parent | 2de8e160c31f3ecf951fb4e85a96aa1e814b0a33 (diff) |
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 <bin.yang@windriver.com>
Diffstat (limited to 'ocata')
-rw-r--r-- | ocata/ocata/extensions/urls.py | 6 | ||||
-rw-r--r-- | ocata/ocata/proxy/urls.py | 4 | ||||
-rw-r--r-- | ocata/ocata/proxy/views/identityV3.py | 6 |
3 files changed, 11 insertions, 5 deletions
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<servicetype>[0-9a-zA-Z_-]{,18})/(?P<requri>[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 |