From 5c42bde257f4abb35ff71a123daf13f71e00bd0a Mon Sep 17 00:00:00 2001 From: Kristi Nikolla Date: Fri, 27 Oct 2017 10:25:52 -0400 Subject: [PATCH] Remove hack for lack of service type Change-Id: I1fbce415369f8d7ee6edd58299df02ad10d86818 --- mixmatch/proxy.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/mixmatch/proxy.py b/mixmatch/proxy.py index 856ac7b..e1e04c1 100644 --- a/mixmatch/proxy.py +++ b/mixmatch/proxy.py @@ -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):