Skip to content

Commit

Permalink
Remove Images API v1 entry points
Browse files Browse the repository at this point in the history
This change removes option to configure Images API v1
This change removes Images API v1 endpoints from the router
This change removes all v1 tests
This change removes the v1 dependant glance-cache-manage command

This change does not remove all v1 codebase. Further cleanup and
decoupling will be needed.

Change-Id: Ia086230cc8c92f7b7dfd5b001923110d5bc55d4d
  • Loading branch information
Erno Kuvaja committed Jul 13, 2018
1 parent f349659 commit 3dde320
Show file tree
Hide file tree
Showing 28 changed files with 21 additions and 6,637 deletions.
2 changes: 0 additions & 2 deletions glance/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@


def root_app_factory(loader, global_conf, **local_conf):
if not CONF.enable_v1_api and '/v1' in local_conf:
del local_conf['/v1']
if not CONF.enable_v2_api and '/v2' in local_conf:
del local_conf['/v2']
return paste.urlmap.urlmap_factory(loader, global_conf, **local_conf)
17 changes: 0 additions & 17 deletions glance/api/middleware/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

from glance.api.common import size_checked_iter
from glance.api import policy
from glance.api.v1 import images
from glance.common import exception
from glance.common import utils
from glance.common import wsgi
Expand All @@ -55,7 +54,6 @@ class CacheFilter(wsgi.Middleware):

def __init__(self, app):
self.cache = image_cache.ImageCache()
self.serializer = images.ImageSerializer()
self.policy = policy.Enforcer()
LOG.info(_LI("Initialized image cache middleware"))
super(CacheFilter, self).__init__(app)
Expand Down Expand Up @@ -214,21 +212,6 @@ def _fetch_request_info(request):
else:
return (image_id, method, version)

def _process_v1_request(self, request, image_id, image_iterator,
image_meta):
# Don't display location
if 'location' in image_meta:
del image_meta['location']
image_meta.pop('location_data', None)
self._verify_metadata(image_meta)

response = webob.Response(request=request)
raw_response = {
'image_iterator': image_iterator,
'image_meta': image_meta,
}
return self.serializer.show(response, raw_response)

def _process_v2_request(self, request, image_id, image_iterator,
image_meta):
# We do some contortions to get the image_metadata so
Expand Down
4 changes: 0 additions & 4 deletions glance/api/middleware/version_negotiation.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ def process_request(self, req):

def _get_allowed_versions(self):
allowed_versions = {}
if CONF.enable_v1_api:
allowed_versions['v1'] = 1
allowed_versions['v1.0'] = 1
allowed_versions['v1.1'] = 1
if CONF.enable_v2_api:
allowed_versions['v2'] = 2
allowed_versions['v2.0'] = 2
Expand Down
Loading

0 comments on commit 3dde320

Please sign in to comment.