api: Purge osapi_compute_* options when httpd is used

... because these options are used only when eventlet server is used.

Change-Id: I486bd74027e85b3c8dbe8ce6c96b2237fbd3ab2a
This commit is contained in:
Takashi Kajinami 2023-11-13 10:02:19 +09:00
parent 3c81436a3a
commit f5aac53305
2 changed files with 15 additions and 9 deletions

View File

@ -260,15 +260,21 @@ as a standalone service, or httpd for being run by a httpd server")
if $service_name != 'httpd' {
nova_config {
'DEFAULT/metadata_workers': value => $metadata_workers;
'DEFAULT/metadata_listen': value => $metadata_listen;
'DEFAULT/metadata_listen_port': value => $metadata_listen_port;
'DEFAULT/osapi_compute_listen': value => $api_bind_address;
'DEFAULT/osapi_compute_listen_port': value => $osapi_compute_listen_port;
'DEFAULT/osapi_compute_workers': value => $osapi_compute_workers;
'DEFAULT/metadata_workers': value => $metadata_workers;
'DEFAULT/metadata_listen': value => $metadata_listen;
'DEFAULT/metadata_listen_port': value => $metadata_listen_port;
}
} else {
nova_config {
'DEFAULT/metadata_workers': ensure => absent;
'DEFAULT/metadata_listen': ensure => absent;
'DEFAULT/metadata_listen_port': ensure => absent;
'DEFAULT/osapi_compute_listen': ensure => absent;
'DEFAULT/osapi_compute_listen_port': ensure => absent;
'DEFAULT/osapi_compute_workers': ensure => absent;
'DEFAULT/metadata_workers': ensure => absent;
'DEFAULT/metadata_listen': ensure => absent;
'DEFAULT/metadata_listen_port': ensure => absent;
}
}
@ -279,9 +285,6 @@ as a standalone service, or httpd for being run by a httpd server")
nova_config {
'wsgi/api_paste_config': value => $api_paste_config;
'DEFAULT/osapi_compute_listen': value => $api_bind_address;
'DEFAULT/osapi_compute_listen_port': value => $osapi_compute_listen_port;
'DEFAULT/osapi_compute_workers': value => $osapi_compute_workers;
'DEFAULT/enable_network_quota': value => $enable_network_quota;
'DEFAULT/password_length': value => $password_length;
'api/use_forwarded_for': value => pick($use_forwarded_for, $facts['os_service_default']);

View File

@ -179,6 +179,9 @@ describe 'nova::api' do
:tag => 'nova-service',
)
is_expected.to contain_nova_config('DEFAULT/enabled_apis').with_ensure('absent')
is_expected.to contain_nova_config('DEFAULT/osapi_compute_workers').with_ensure('absent')
is_expected.to contain_nova_config('DEFAULT/osapi_compute_listen').with_ensure('absent')
is_expected.to contain_nova_config('DEFAULT/osapi_compute_listen_port').with_ensure('absent')
is_expected.to contain_nova_config('DEFAULT/metadata_workers').with_ensure('absent')
is_expected.to contain_nova_config('DEFAULT/metadata_listen').with_ensure('absent')
is_expected.to contain_nova_config('DEFAULT/metadata_listen_port').with_ensure('absent')