Remove deprecated nova::api::instance_name_template

This parameter was deprecated during the previous cycle in favor of
the same parameter in the base nova class.

Change-Id: I8982d2e856fce3b5769f0380cd481c298cae7917
This commit is contained in:
Takashi Kajinami 2023-04-07 13:54:45 +09:00
parent a1c5e3ebf4
commit d6a8f219c8
5 changed files with 8 additions and 45 deletions

View File

@ -160,10 +160,6 @@
# enable this if you have a sanitizing proxy. # enable this if you have a sanitizing proxy.
# Defaults to undef # Defaults to undef
# #
# [*instance_name_template*]
# (optional) Template string to be used to generate instance names
# Defaults to undef
#
class nova::api( class nova::api(
$enabled = true, $enabled = true,
$manage_service = true, $manage_service = true,
@ -199,7 +195,6 @@ class nova::api(
# DEPRECATED PARAMETER # DEPRECATED PARAMETER
$nova_metadata_wsgi_enabled = false, $nova_metadata_wsgi_enabled = false,
$use_forwarded_for = undef, $use_forwarded_for = undef,
$instance_name_template = undef,
) inherits nova::params { ) inherits nova::params {
include nova::deps include nova::deps
@ -223,21 +218,6 @@ class nova::api(
warning('The use_forwarded_for parameter has been deprecated.') warning('The use_forwarded_for parameter has been deprecated.')
} }
if $instance_name_template != undef {
warning("The nova::api::instance_name_template parameter is deprecated. \
Use the nova::instance_name_template parameter instead.")
nova_config {
'DEFAULT/instance_name_template': value => $instance_name_template;
}
} else {
# Try best to clean up the parameter
if defined(Class['nova']) and $::nova::instance_name_template == undef {
nova_config {
'DEFAULT/instance_name_template': value => $facts['os_service_default'];
}
}
}
# enable metadata in eventlet if we do not run metadata via wsgi (nova::metadata) # enable metadata in eventlet if we do not run metadata via wsgi (nova::metadata)
if ('metadata' in $enabled_apis and $service_name == 'httpd' and !$nova_metadata_wsgi_enabled) { if ('metadata' in $enabled_apis and $service_name == 'httpd' and !$nova_metadata_wsgi_enabled) {
$enable_metadata = true $enable_metadata = true

View File

@ -358,7 +358,7 @@
# #
# [*instance_name_template*] # [*instance_name_template*]
# (optional) Template string to be used to generate instance names # (optional) Template string to be used to generate instance names
# Defaults to undef # Defaults to $facts['os_service_default']
# #
# DEPRECATED PARAMETERS # DEPRECATED PARAMETERS
# #
@ -449,7 +449,7 @@ class nova(
$purge_config = false, $purge_config = false,
$my_ip = $facts['os_service_default'], $my_ip = $facts['os_service_default'],
$dhcp_domain = $facts['os_service_default'], $dhcp_domain = $facts['os_service_default'],
$instance_name_template = undef, $instance_name_template = $facts['os_service_default'],
# DEPRECATED PARAMETERS # DEPRECATED PARAMETERS
$auth_strategy = undef, $auth_strategy = undef,
$upgrade_level_cert = undef, $upgrade_level_cert = undef,
@ -575,14 +575,7 @@ but should be one of: ssh-rsa, ssh-dsa, ssh-ecdsa.")
'DEFAULT/initial_ram_allocation_ratio': value => $initial_ram_allocation_ratio; 'DEFAULT/initial_ram_allocation_ratio': value => $initial_ram_allocation_ratio;
'DEFAULT/initial_disk_allocation_ratio': value => $initial_disk_allocation_ratio; 'DEFAULT/initial_disk_allocation_ratio': value => $initial_disk_allocation_ratio;
'DEFAULT/dhcp_domain': value => $dhcp_domain; 'DEFAULT/dhcp_domain': value => $dhcp_domain;
} 'DEFAULT/instance_name_template': value => $instance_name_template;
# TODO(tkajinam): Change the default value to $facts['os_service_default'] when we
# remove nova::api::instance_name_template after Antelope.
if $instance_name_template != undef {
nova_config {
'DEFAULT/instance_name_template': value => $instance_name_template;
}
} }
oslo::messaging::rabbit {'nova_config': oslo::messaging::rabbit {'nova_config':

View File

@ -0,0 +1,4 @@
---
upgrade:
- |
The ``nova::api::instance_name_template`` parameter has been removed.

View File

@ -45,7 +45,6 @@ describe 'nova::api' do
it { is_expected.to contain_class('nova::availability_zone') } it { is_expected.to contain_class('nova::availability_zone') }
it 'configures various stuff' do it 'configures various stuff' do
is_expected.to contain_nova_config('DEFAULT/instance_name_template').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('wsgi/api_paste_config').with_value('api-paste.ini') is_expected.to contain_nova_config('wsgi/api_paste_config').with_value('api-paste.ini')
is_expected.to contain_nova_config('DEFAULT/osapi_compute_listen').with_value('<SERVICE DEFAULT>') is_expected.to contain_nova_config('DEFAULT/osapi_compute_listen').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('DEFAULT/osapi_compute_listen_port').with_value('<SERVICE DEFAULT>') is_expected.to contain_nova_config('DEFAULT/osapi_compute_listen_port').with_value('<SERVICE DEFAULT>')
@ -157,17 +156,6 @@ describe 'nova::api' do
it { is_expected.to_not contain_service('nova-api') } it { is_expected.to_not contain_service('nova-api') }
end end
context 'with custom instance_name_template' do
before do
params.merge!({
:instance_name_template => 'instance-%08x',
})
end
it 'configures instance_name_template' do
is_expected.to contain_nova_config('DEFAULT/instance_name_template').with_value('instance-%08x');
end
end
context 'when running nova API in wsgi compute, and enabling metadata' do context 'when running nova API in wsgi compute, and enabling metadata' do
before do before do
params.merge!({ :service_name => 'httpd' }) params.merge!({ :service_name => 'httpd' })

View File

@ -97,9 +97,7 @@ describe 'nova' do
is_expected.to contain_nova_config('console/ssl_ciphers').with_value('<SERVICE DEFAULT>') is_expected.to contain_nova_config('console/ssl_ciphers').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('console/ssl_minimum_version').with_value('<SERVICE DEFAULT>') is_expected.to contain_nova_config('console/ssl_minimum_version').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('DEFAULT/dhcp_domain').with_value('<SERVICE DEFAULT>') is_expected.to contain_nova_config('DEFAULT/dhcp_domain').with_value('<SERVICE DEFAULT>')
# TODO(tkajinam): Uncomment this when we change default value of is_expected.to contain_nova_config('DEFAULT/instance_name_template').with_value('<SERVICE DEFAULT>')
# nova::instance_name_template
# is_expected.to contain_nova_config('DEFAULT/instance_name_template').with_value('<SERVICE DEFAULT>')
end end
end end