conf: Remove deprecated `use_glance_v1
`
Glance option ``use_glance_v1`` was deprecated and listed as to be removed for Ocata. This patch removes it. Blueprint centralize-config-options-ocata Change-Id: Id891172418535a88fefb8ea05d774fe39dc14eaf
This commit is contained in:
@ -66,17 +66,6 @@ invoking a copy when it has access to the same file system as glance.
|
||||
Possible values:
|
||||
|
||||
* [file], Empty list (default)
|
||||
"""),
|
||||
cfg.BoolOpt('use_glance_v1',
|
||||
default=False,
|
||||
deprecated_for_removal=True,
|
||||
deprecated_since="14.0.0",
|
||||
deprecated_reason='Glance v1 support will be removed in '
|
||||
'Ocata',
|
||||
help="""
|
||||
This flag allows reverting to glance v1 if for some reason glance v2 doesn't
|
||||
work in your environment. This will only exist in Newton, and a fully working
|
||||
Glance v2 will be a hard requirement in Ocata.
|
||||
"""),
|
||||
cfg.BoolOpt('verify_glance_signatures',
|
||||
default=False,
|
||||
|
@ -129,10 +129,7 @@ class GlanceClientWrapper(object):
|
||||
"""Glance client wrapper class that implements retries."""
|
||||
|
||||
def __init__(self, context=None, endpoint=None):
|
||||
if CONF.glance.use_glance_v1:
|
||||
version = 1
|
||||
else:
|
||||
version = 2
|
||||
version = 2
|
||||
if endpoint is not None:
|
||||
self.client = self._create_static_client(context,
|
||||
endpoint,
|
||||
@ -872,11 +869,7 @@ def _is_image_available(context, image):
|
||||
def _translate_to_glance(image_meta):
|
||||
image_meta = _convert_to_string(image_meta)
|
||||
image_meta = _remove_read_only(image_meta)
|
||||
# TODO(mfedosin): Remove this check once we move to glance V2
|
||||
# completely and enable convert to v2 every time.
|
||||
if not CONF.glance.use_glance_v1:
|
||||
# v2 requires several additional changes
|
||||
image_meta = _convert_to_v2(image_meta)
|
||||
image_meta = _convert_to_v2(image_meta)
|
||||
return image_meta
|
||||
|
||||
|
||||
@ -913,14 +906,8 @@ def _convert_to_v2(image_meta):
|
||||
|
||||
|
||||
def _translate_from_glance(image, include_locations=False):
|
||||
# TODO(mfedosin): Remove this check once we move to glance V2
|
||||
# completely.
|
||||
if CONF.glance.use_glance_v1:
|
||||
image_meta = _extract_attributes(
|
||||
image, include_locations=include_locations)
|
||||
else:
|
||||
image_meta = _extract_attributes_v2(
|
||||
image, include_locations=include_locations)
|
||||
image_meta = _extract_attributes_v2(
|
||||
image, include_locations=include_locations)
|
||||
|
||||
image_meta = _convert_timestamps_to_datetimes(image_meta)
|
||||
image_meta = _convert_from_string(image_meta)
|
||||
@ -1118,22 +1105,12 @@ def get_remote_image_service(context, image_href):
|
||||
except ValueError:
|
||||
raise exception.InvalidImageRef(image_href=image_href)
|
||||
|
||||
# TODO(sbiswas7): Remove this check once we move to glance V2
|
||||
# completely.
|
||||
if CONF.glance.use_glance_v1:
|
||||
image_service = GlanceImageService(client=glance_client)
|
||||
else:
|
||||
image_service = GlanceImageServiceV2(client=glance_client)
|
||||
image_service = GlanceImageServiceV2(client=glance_client)
|
||||
return image_service, image_id
|
||||
|
||||
|
||||
def get_default_image_service():
|
||||
# TODO(sbiswas7): Remove this check once we move to glance V2
|
||||
# completely.
|
||||
if CONF.glance.use_glance_v1:
|
||||
return GlanceImageService()
|
||||
else:
|
||||
return GlanceImageServiceV2()
|
||||
return GlanceImageServiceV2()
|
||||
|
||||
|
||||
class UpdateGlanceImage(object):
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -36,7 +36,6 @@ class TestGlanceStore(stubs.XenAPITestBaseNoDB):
|
||||
self.store = glance.GlanceStore()
|
||||
|
||||
self.flags(api_servers=['http://localhost:9292'], group='glance')
|
||||
self.flags(use_glance_v1=True, group='glance')
|
||||
self.flags(connection_url='test_url',
|
||||
connection_password='test_pass',
|
||||
group='xenserver')
|
||||
@ -62,7 +61,7 @@ class TestGlanceStore(stubs.XenAPITestBaseNoDB):
|
||||
return {'image_id': 'fake_image_uuid',
|
||||
'endpoint': 'http://localhost:9292',
|
||||
'sr_path': '/fake/sr/path',
|
||||
'api_version': 1,
|
||||
'api_version': 2,
|
||||
'extra_headers': {'X-Auth-Token': 'foobar',
|
||||
'X-Roles': '',
|
||||
'X-Tenant-Id': 'project',
|
||||
|
@ -37,7 +37,7 @@ class GlanceStore(object):
|
||||
def pick_glance(kwargs):
|
||||
server = next(glance_api_servers)
|
||||
kwargs['endpoint'] = server
|
||||
kwargs['api_version'] = 1 if CONF.glance.use_glance_v1 else 2
|
||||
kwargs['api_version'] = 2
|
||||
# NOTE(sdague): is the return significant here at all?
|
||||
return server
|
||||
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
upgrade:
|
||||
- |
|
||||
``use_glance_v1`` option was removed due to plans to remove Glance V1
|
||||
support during Ocata development.
|
Reference in New Issue
Block a user