Remove hack for lack of service type

Change-Id: I1fbce415369f8d7ee6edd58299df02ad10d86818
This commit is contained in:
Kristi Nikolla 2017-10-27 10:25:52 -04:00
parent 03c0ccbbc2
commit 5c42bde257
1 changed files with 4 additions and 9 deletions

View File

@ -40,16 +40,11 @@ def stream_response(response):
def get_service(a):
"""Determine service type based on path."""
# NOTE(knikolla): Workaround to fix glance requests that do not
# contain image as the first part of the path.
if a[0] in ['v1', 'v2']:
return 'image'
service = a.pop(0)
if service in ['image', 'volume', 'network']:
return service
else:
service = a.pop(0)
if service in ['image', 'volume', 'network']:
return service
else:
abort(404)
abort(404)
def is_json_response(response):