Allow both DEFAULT/dhcp_domain and api/dhcp_domain to be set

Partial revert of If6a26527a737a7184ebddd5b4bc346d64827e9e3 to allow
both/either config option to be used until it is clear what nova will
take.

Related-bug: #1903908
Change-Id: I98fe83e0c245388944529cd19b5e2bbed134e855
This commit is contained in:
Oliver Walsh 2020-12-02 12:29:45 +00:00
parent 18be6c394e
commit e8b24805d6
4 changed files with 8 additions and 20 deletions

View File

@ -696,8 +696,6 @@ but should be one of: ssh-rsa, ssh-dsa, ssh-ecdsa.")
nova_config { 'api/auth_strategy': value => $auth_strategy }
}
$dhcp_domain_real = pick($::nova::metadata::dhcp_domain, $dhcp_domain)
nova_config {
'DEFAULT/ssl_only': value => $ssl_only;
'DEFAULT/cert': value => $cert;
@ -709,7 +707,7 @@ but should be one of: ssh-rsa, ssh-dsa, ssh-ecdsa.")
'DEFAULT/cpu_allocation_ratio': value => $cpu_allocation_ratio;
'DEFAULT/ram_allocation_ratio': value => $ram_allocation_ratio;
'DEFAULT/disk_allocation_ratio': value => $disk_allocation_ratio;
'DEFAULT/dhcp_domain': value => $dhcp_domain_real;
'DEFAULT/dhcp_domain': value => $dhcp_domain;
}
oslo::messaging::rabbit {'nova_config':

View File

@ -24,11 +24,11 @@
# service.
# Defaults to $::os_service_default
#
# DEPRECATED
#
# [*dhcp_domain*]
# (optional) domain to use for building the hostnames
# Defaults to undef.
# Defaults to $::os_service_default
#
# DEPRECATED
#
# [*enabled_apis*]
# (optional) A list of apis to enable
@ -47,8 +47,8 @@ class nova::metadata(
$neutron_metadata_proxy_shared_secret = undef,
$metadata_cache_expiration = $::os_service_default,
$local_metadata_per_cell = $::os_service_default,
$dhcp_domain = $::os_service_default,
# DEPRECATED PARAMETERS
$dhcp_domain = undef,
$enabled_apis = undef,
$enable_proxy_headers_parsing = undef,
$max_request_body_size = undef,
@ -70,11 +70,9 @@ and will be removed in the future. Please use the one ::nova::api.')
warning('max_request_body_size in ::nova::metadata is deprecated, has no effect \
and will be removed in the future. Please use the one ::nova::api.')
}
if $dhcp_domain {
warning('dhcp_domain in nova::metadata is deprecated, use nova::dhcp_domain instead.')
}
nova_config {
'api/dhcp_domain': value => $dhcp_domain;
'api/metadata_cache_expiration': value => $metadata_cache_expiration;
'api/local_metadata_per_cell': value => $local_metadata_per_cell;
}

View File

@ -1,8 +0,0 @@
---
fixes:
- |
The nova::metadata::dhcp_domain paramater has been deprecated by
nova::dhcp_domain as the nova config option is also required for
nova-compute.
[Bug `1903908 <https://bugs.launchpad.net/nova/+bug/1903908>`_]

View File

@ -22,7 +22,7 @@ describe 'nova::metadata' do
it 'configures various stuff' do
is_expected.to contain_nova_config('api/metadata_cache_expiration').with('value' => '<SERVICE DEFAULT>')
is_expected.to contain_nova_config('api/local_metadata_per_cell').with('value' => '<SERVICE DEFAULT>')
is_expected.to_not contain_nova_config('api/dhcp_domain')
is_expected.to contain_nova_config('api/dhcp_domain').with('value' => '<SERVICE DEFAULT>')
end
it 'unconfigures neutron_metadata proxy' do
@ -44,7 +44,7 @@ describe 'nova::metadata' do
it 'configures various stuff' do
is_expected.to contain_nova_config('api/local_metadata_per_cell').with('value' => true)
is_expected.to contain_nova_config('api/metadata_cache_expiration').with('value' => '15')
is_expected.to_not contain_nova_config('api/dhcp_domain')
is_expected.to contain_nova_config('api/dhcp_domain').with('value' => 'foo')
is_expected.to contain_nova_config('neutron/service_metadata_proxy').with('value' => true)
is_expected.to contain_nova_config('neutron/metadata_proxy_shared_secret').with('value' => 'secrete').with_secret(true)
end