Merge "conf: Remove deprecated 'null_kernel' opt"

This commit is contained in:
Zuul 2017-10-21 05:18:24 +00:00 committed by Gerrit Code Review
commit 02dce6fc43
5 changed files with 30 additions and 36 deletions

View File

@ -408,13 +408,14 @@ class API(base.Base):
image):
"""Choose kernel and ramdisk appropriate for the instance.
The kernel and ramdisk can be chosen in one of three ways:
The kernel and ramdisk can be chosen in one of two ways:
1. Passed in with create-instance request.
2. Inherited from image.
2. Inherited from image metadata.
3. Forced to None by using `null_kernel` FLAG.
If inherited from image metadata, and if that image metadata value is
set to 'nokernel', both kernel and ramdisk will default to None.
"""
# Inherit from image if not specified
image_properties = image.get('properties', {})
@ -425,8 +426,8 @@ class API(base.Base):
if ramdisk_id is None:
ramdisk_id = image_properties.get('ramdisk_id')
# Force to None if using null_kernel
if kernel_id == str(CONF.null_kernel):
# Force to None if kernel_id indicates that a kernel is not to be used
if kernel_id == 'nokernel':
kernel_id = None
ramdisk_id = None

View File

@ -68,23 +68,6 @@ Possible values:
here, since the snapshots that are created from the base images don't
need them.
* Default list: cache_in_nova, bittorrent
"""),
cfg.StrOpt('null_kernel',
default='nokernel',
deprecated_for_removal=True,
deprecated_since='15.0.0',
deprecated_reason="""
When an image is booted with the property 'kernel_id' with the value
'nokernel', Nova assumes the image doesn't require an external kernel and
ramdisk. This option allows user to change the API behaviour which should not
be allowed and this value "nokernel" should be hard coded.
""",
help="""
This option is used to decide when an image should have no external
ramdisk or kernel. By default this is set to 'nokernel', so when an
image is booted with the property 'kernel_id' with the value
'nokernel', Nova assumes the image doesn't require an external kernel
and ramdisk.
"""),
cfg.StrOpt('multi_instance_display_name_template',
default='%(name)s-%(count)d',

View File

@ -53,8 +53,8 @@ class TestServerGet(test.TestCase):
'container_format': 'raw',
'disk_format': 'raw',
'size': '25165824',
'properties': {'kernel_id': CONF.null_kernel,
'ramdisk_id': CONF.null_kernel,
'properties': {'kernel_id': 'nokernel',
'ramdisk_id': 'nokernel',
'architecture': 'x64'}}
self.image_id = image_service.create(None, image)['id']
self.flavor_id = self.api.get_flavors()[0]['id']

View File

@ -53,8 +53,8 @@ class _FakeImageService(object):
'disk_format': 'raw',
'size': '25165824',
'properties': {
'kernel_id': CONF.null_kernel,
'ramdisk_id': CONF.null_kernel,
'kernel_id': 'nokernel',
'ramdisk_id': 'nokernel',
'architecture': obj_fields.Architecture.X86_64}}
image2 = {'id': 'a2459075-d96c-40d5-893e-577ff92e721c',
@ -68,8 +68,8 @@ class _FakeImageService(object):
'container_format': 'ami',
'disk_format': 'ami',
'size': '58145823',
'properties': {'kernel_id': CONF.null_kernel,
'ramdisk_id': CONF.null_kernel}}
'properties': {'kernel_id': 'nokernel',
'ramdisk_id': 'nokernel'}}
image3 = {'id': '76fa36fc-c930-4bf3-8c8a-ea2a2420deb6',
'name': 'fakeimage123456',
@ -82,8 +82,8 @@ class _FakeImageService(object):
'container_format': 'bare',
'disk_format': 'raw',
'size': '83594576',
'properties': {'kernel_id': CONF.null_kernel,
'ramdisk_id': CONF.null_kernel}}
'properties': {'kernel_id': 'nokernel',
'ramdisk_id': 'nokernel'}}
image4 = {'id': 'cedef40a-ed67-4d10-800e-17455edce175',
'name': 'fakeimage123456',
@ -96,8 +96,8 @@ class _FakeImageService(object):
'container_format': 'ami',
'disk_format': 'ami',
'size': '84035174',
'properties': {'kernel_id': CONF.null_kernel,
'ramdisk_id': CONF.null_kernel}}
'properties': {'kernel_id': 'nokernel',
'ramdisk_id': 'nokernel'}}
image5 = {'id': 'c905cedb-7281-47e4-8a62-f26bc5fc4c77',
'name': 'fakeimage123456',
@ -126,8 +126,8 @@ class _FakeImageService(object):
'disk_format': 'vhd',
'size': '49163826',
'properties': {
'kernel_id': CONF.null_kernel,
'ramdisk_id': CONF.null_kernel,
'kernel_id': 'nokernel',
'ramdisk_id': 'nokernel',
'architecture': obj_fields.Architecture.X86_64,
'auto_disk_config': 'False'}}
@ -143,8 +143,8 @@ class _FakeImageService(object):
'disk_format': 'vhd',
'size': '74185822',
'properties': {
'kernel_id': CONF.null_kernel,
'ramdisk_id': CONF.null_kernel,
'kernel_id': 'nokernel',
'ramdisk_id': 'nokernel',
'architecture': obj_fields.Architecture.X86_64,
'auto_disk_config': 'True'}}

View File

@ -0,0 +1,10 @@
---
upgrade:
- |
The following deprecated configuration options have been removed from the
``compute`` section of ``nova.conf``:
- ``null_kernel``
These were deprecated in the 15.0.0 release as they allowed for
inconsistent API behavior across deployments.