From 8761795c43123779c6494944f9bdef6e19491ab2 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sat, 23 Apr 2022 00:17:11 +0900 Subject: [PATCH] Remove redundant default of [api] use_forwarded_for This parameter defaults to false, thus the hard-coded default can be replaced by $::os_service_default. Change-Id: I8a2f5a0e34010cd58032df0a3d858aff17647a7a --- manifests/api.pp | 4 ++-- spec/classes/nova_api_spec.rb | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/manifests/api.pp b/manifests/api.pp index f31a75e9f..00917f7a9 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -39,7 +39,7 @@ # [*use_forwarded_for*] # (optional) Treat X-Forwarded-For as the canonical remote address. Only # enable this if you have a sanitizing proxy. -# Defaults to false +# Defaults to $::os_service_default # # [*osapi_compute_workers*] # (optional) Number of workers for OpenStack API service @@ -200,7 +200,7 @@ class nova::api( $metadata_listen = $::os_service_default, $metadata_listen_port = $::os_service_default, $enabled_apis = ['osapi_compute', 'metadata'], - $use_forwarded_for = false, + $use_forwarded_for = $::os_service_default, $osapi_compute_workers = $::os_workers, $metadata_workers = $::os_workers, $sync_db = true, diff --git a/spec/classes/nova_api_spec.rb b/spec/classes/nova_api_spec.rb index 2ddbeadfe..43ef1e197 100644 --- a/spec/classes/nova_api_spec.rb +++ b/spec/classes/nova_api_spec.rb @@ -49,6 +49,7 @@ describe 'nova::api' do 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('') + is_expected.to contain_nova_config('api/use_forwarded_for').with_value('') is_expected.to contain_nova_config('DEFAULT/metadata_listen').with_value('') is_expected.to contain_nova_config('DEFAULT/metadata_listen_port').with_value('') is_expected.to contain_nova_config('DEFAULT/osapi_compute_workers').with_value('5')