Merge "REST API returns traceback fix"

This commit is contained in:
Jenkins 2013-07-17 12:34:00 +00:00 committed by Gerrit Code Review
commit fbf77a34ad
3 changed files with 3 additions and 3 deletions

View File

@ -8,6 +8,7 @@ Jon Maron <jmaron@hortonworks.com>
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