Refactor logic about the instance_name_template parameter
We don't need to implement a speicific logic to ensure the parameter is absent but can pass $::os_service_default. This change updates default of the instance_name_template parameter so that we can simplify our current logic to manage the parameter. Change-Id: I5fcd8e15c5b3a3386104506fb9f7b54eda2eb867
This commit is contained in:
parent
7efa708f76
commit
771b0bbe4e
@ -55,7 +55,7 @@
|
||||
#
|
||||
# [*instance_name_template*]
|
||||
# (optional) Template string to be used to generate instance names
|
||||
# Defaults to undef
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*sync_db*]
|
||||
# (optional) Run nova-manage db sync on api nodes after installing the package.
|
||||
@ -199,7 +199,7 @@ class nova::api(
|
||||
'nova.api.openstack.compute.limits:RateLimitingMiddleware.factory',
|
||||
$validate = false,
|
||||
$validation_options = {},
|
||||
$instance_name_template = undef,
|
||||
$instance_name_template = $::os_service_default,
|
||||
$service_name = $::nova::params::api_service_name,
|
||||
$metadata_service_name = $::nova::params::api_metadata_service_name,
|
||||
$enable_proxy_headers_parsing = $::os_service_default,
|
||||
@ -235,13 +235,13 @@ class nova::api(
|
||||
}
|
||||
|
||||
if $instance_name_template {
|
||||
nova_config {
|
||||
'DEFAULT/instance_name_template': value => $instance_name_template;
|
||||
}
|
||||
$instance_name_template_real = $instance_name_template
|
||||
} else {
|
||||
nova_config{
|
||||
'DEFAULT/instance_name_template': ensure => absent;
|
||||
}
|
||||
warning('Using a false value for instance_name_template is deprecated. Use $::os_service_default instead.')
|
||||
$instance_name_template_real = $::os_service_default
|
||||
}
|
||||
nova_config {
|
||||
'DEFAULT/instance_name_template': value => $instance_name_template_real;
|
||||
}
|
||||
|
||||
# enable metadata in eventlet if we do not run metadata via wsgi (nova::metadata)
|
||||
|
@ -0,0 +1,8 @@
|
||||
---
|
||||
deprecations:
|
||||
- |
|
||||
Default value of ``nova::api::instance_name_template`` has been changed
|
||||
from ``undef`` to ``$::os_service_default``. The parameter still accepts
|
||||
any false value then unsets the parameter, but this behavior will be
|
||||
changed in a future release. Use ``$::os_service_default`` if you want to
|
||||
use the default defined in nova implementation.
|
@ -43,11 +43,11 @@ describe 'nova::api' do
|
||||
is_expected.to contain_nova_config('DEFAULT/enabled_apis').with_value('osapi_compute,metadata')
|
||||
end
|
||||
|
||||
it { is_expected.to contain_nova_config('DEFAULT/instance_name_template').with_ensure('absent')}
|
||||
|
||||
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' => '<SERVICE DEFAULT>')
|
||||
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' => '0.0.0.0')
|
||||
is_expected.to contain_nova_config('DEFAULT/osapi_compute_listen_port').with('value' => '8774')
|
||||
|
Loading…
Reference in New Issue
Block a user