diff --git a/manifests/api.pp b/manifests/api.pp index 467d8d010..81749cccc 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -160,10 +160,6 @@ # enable this if you have a sanitizing proxy. # Defaults to undef # -# [*instance_name_template*] -# (optional) Template string to be used to generate instance names -# Defaults to undef -# class nova::api( $enabled = true, $manage_service = true, @@ -199,7 +195,6 @@ class nova::api( # DEPRECATED PARAMETER $nova_metadata_wsgi_enabled = false, $use_forwarded_for = undef, - $instance_name_template = undef, ) inherits nova::params { include nova::deps @@ -223,21 +218,6 @@ class nova::api( 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) if ('metadata' in $enabled_apis and $service_name == 'httpd' and !$nova_metadata_wsgi_enabled) { $enable_metadata = true diff --git a/manifests/init.pp b/manifests/init.pp index c1a4d4964..f5c13d52d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -358,7 +358,7 @@ # # [*instance_name_template*] # (optional) Template string to be used to generate instance names -# Defaults to undef +# Defaults to $facts['os_service_default'] # # DEPRECATED PARAMETERS # @@ -449,7 +449,7 @@ class nova( $purge_config = false, $my_ip = $facts['os_service_default'], $dhcp_domain = $facts['os_service_default'], - $instance_name_template = undef, + $instance_name_template = $facts['os_service_default'], # DEPRECATED PARAMETERS $auth_strategy = 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_disk_allocation_ratio': value => $initial_disk_allocation_ratio; 'DEFAULT/dhcp_domain': value => $dhcp_domain; - } - - # 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; - } + 'DEFAULT/instance_name_template': value => $instance_name_template; } oslo::messaging::rabbit {'nova_config': diff --git a/releasenotes/notes/remove-api-instance_name_template-8b3b1e0afdbbba1a.yaml b/releasenotes/notes/remove-api-instance_name_template-8b3b1e0afdbbba1a.yaml new file mode 100644 index 000000000..57c2c39b5 --- /dev/null +++ b/releasenotes/notes/remove-api-instance_name_template-8b3b1e0afdbbba1a.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - | + The ``nova::api::instance_name_template`` parameter has been removed. diff --git a/spec/classes/nova_api_spec.rb b/spec/classes/nova_api_spec.rb index c9be9cee8..9e809e946 100644 --- a/spec/classes/nova_api_spec.rb +++ b/spec/classes/nova_api_spec.rb @@ -45,7 +45,6 @@ describe 'nova::api' do it { is_expected.to contain_class('nova::availability_zone') } it 'configures various stuff' do - is_expected.to contain_nova_config('DEFAULT/instance_name_template').with_value('') 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('') is_expected.to contain_nova_config('DEFAULT/osapi_compute_listen_port').with_value('') @@ -157,17 +156,6 @@ describe 'nova::api' do it { is_expected.to_not contain_service('nova-api') } 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 before do params.merge!({ :service_name => 'httpd' }) diff --git a/spec/classes/nova_init_spec.rb b/spec/classes/nova_init_spec.rb index 32e860d83..ed11bbca4 100644 --- a/spec/classes/nova_init_spec.rb +++ b/spec/classes/nova_init_spec.rb @@ -97,9 +97,7 @@ describe 'nova' do is_expected.to contain_nova_config('console/ssl_ciphers').with_value('') is_expected.to contain_nova_config('console/ssl_minimum_version').with_value('') is_expected.to contain_nova_config('DEFAULT/dhcp_domain').with_value('') - # TODO(tkajinam): Uncomment this when we change default value of - # nova::instance_name_template - # is_expected.to contain_nova_config('DEFAULT/instance_name_template').with_value('') + is_expected.to contain_nova_config('DEFAULT/instance_name_template').with_value('') end end