REST API returns traceback fix

Fixes: bug #1200245

Change-Id: Ie23e1d6910892c55f729153cf5a3b238a4d3c605
This commit is contained in:
Nikolay Mahotkin 2013-07-16 19:22:15 +04:00
parent d929c45c9b
commit c23227411b
3 changed files with 3 additions and 3 deletions

View File

@ -7,6 +7,7 @@ Jeremy Stanley <fungi@yuggoth.org>
Matthew Farrellee <matt@redhat.com>
Nadya Privalova <nprivalova@mirantis.com>
Nikita Konovalov <nkonovalov@mirantis.com>
Nikolay Mahotkin <nmakhotkin@mirantis.com>
Ruslan Kamaldinov <rkamaldinov@mirantis.com>
Sergey Lukjanov <slukjanov@mirantis.com>
Sergey Reshetnyak <sreshetniak@mirantis.com>

View File

@ -47,11 +47,10 @@ class AuthValidator:
path = env['PATH_INFO']
if path != '/':
version, url_tenant, rest = commons.split_path(path, 3, 3, True)
if not version or not url_tenant or not rest:
LOG.info("Incorrect path: %s", path)
resp = ex.HTTPNotFound("Incorrect path")
resp(env, start_response)
return resp(env, start_response)
if token_tenant != url_tenant:
LOG.debug("Unauthorized: token tenant != requested tenant")

View File

@ -52,7 +52,7 @@ def split_path(path, minsegs=1, maxsegs=None, rest_with_last=False):
count = len(segs)
if (segs[0] or count < minsegs or count > maxsegs or
'' in segs[1:minsegs]):
raise ValueError('Invalid path: %s' % path)
return None, None, None
else:
minsegs += 1
maxsegs += 1