From f0a77d2cc2fe0939afc13f0db59fff7988d72df4 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 1 Dec 2023 15:34:16 +0900 Subject: [PATCH] Remove redundant hardcoded default of log_headers The log_headers option defaults to no (which is effectively same as False), so we don't have to explicitly set this option. Change-Id: I0463331018dd1ff844caf0bc54f9abfe4627420e --- manifests/proxy.pp | 4 ++-- manifests/proxy/gatekeeper.pp | 4 ++-- spec/classes/swift_proxy_gatekeeper_spec.rb | 4 +++- spec/classes/swift_proxy_spec.rb | 7 ++++--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/manifests/proxy.pp b/manifests/proxy.pp index 2acde17e..f7e5a2d5 100644 --- a/manifests/proxy.pp +++ b/manifests/proxy.pp @@ -36,7 +36,7 @@ # # [*log_headers*] # (optional) If True, log headers in each request -# Defaults to False. +# Defaults to $facts['os_service_default']. # # [*log_udp_host*] # (optional) If not set, the UDP receiver for syslog is disabled. @@ -159,7 +159,7 @@ class swift::proxy( $workers = $facts['os_workers'], Boolean $allow_account_management = true, Boolean $account_autocreate = true, - $log_headers = 'False', + $log_headers = $facts['os_service_default'], $log_udp_host = $facts['os_service_default'], $log_udp_port = $facts['os_service_default'], $log_address = '/dev/log', diff --git a/manifests/proxy/gatekeeper.pp b/manifests/proxy/gatekeeper.pp index 91672943..845e98c3 100644 --- a/manifests/proxy/gatekeeper.pp +++ b/manifests/proxy/gatekeeper.pp @@ -31,7 +31,7 @@ # # [*log_headers*] # (Optional) The log headers of gatekeeper. -# Defaults to false. +# Defaults to $facts['os_service_default']. # # [*log_address*] # (Optional) The log address of gatekeeper. @@ -51,7 +51,7 @@ class swift::proxy::gatekeeper( $log_name = 'gatekeeper', $log_facility = 'LOG_LOCAL2', $log_level = 'INFO', - $log_headers = false, + $log_headers = $facts['os_service_default'], $log_address = '/dev/log' ) { diff --git a/spec/classes/swift_proxy_gatekeeper_spec.rb b/spec/classes/swift_proxy_gatekeeper_spec.rb index fa97ddd4..ccb3ab99 100644 --- a/spec/classes/swift_proxy_gatekeeper_spec.rb +++ b/spec/classes/swift_proxy_gatekeeper_spec.rb @@ -9,7 +9,7 @@ describe 'swift::proxy::gatekeeper' do it { is_expected.to contain_swift_proxy_config('filter:gatekeeper/set log_name').with_value('gatekeeper') } it { is_expected.to contain_swift_proxy_config('filter:gatekeeper/set log_facility').with_value('LOG_LOCAL2') } it { is_expected.to contain_swift_proxy_config('filter:gatekeeper/set log_level').with_value('INFO') } - it { is_expected.to contain_swift_proxy_config('filter:gatekeeper/set log_headers').with_value('false') } + it { is_expected.to contain_swift_proxy_config('filter:gatekeeper/set log_headers').with_value('') } it { is_expected.to contain_swift_proxy_config('filter:gatekeeper/set log_address').with_value('/dev/log') } end @@ -19,6 +19,7 @@ describe 'swift::proxy::gatekeeper' do :shunt_inbound_x_timestamp => true, :allow_reserved_names_header => false, :log_name => 'newgatekeeper', + :log_headers => false, :log_facility => 'LOG_LOCAL3', :log_level => 'WARN', } @@ -29,6 +30,7 @@ describe 'swift::proxy::gatekeeper' do it { is_expected.to contain_swift_proxy_config('filter:gatekeeper/set log_name').with_value('newgatekeeper') } it { is_expected.to contain_swift_proxy_config('filter:gatekeeper/set log_facility').with_value('LOG_LOCAL3') } it { is_expected.to contain_swift_proxy_config('filter:gatekeeper/set log_level').with_value('WARN') } + it { is_expected.to contain_swift_proxy_config('filter:gatekeeper/set log_headers').with_value(false) } end end diff --git a/spec/classes/swift_proxy_spec.rb b/spec/classes/swift_proxy_spec.rb index 3c456560..43e399c8 100644 --- a/spec/classes/swift_proxy_spec.rb +++ b/spec/classes/swift_proxy_spec.rb @@ -55,7 +55,7 @@ describe 'swift::proxy' do it { should contain_swift_proxy_config('DEFAULT/log_name').with_value('proxy-server') } it { should contain_swift_proxy_config('DEFAULT/log_facility').with_value('LOG_LOCAL2') } it { should contain_swift_proxy_config('DEFAULT/log_level').with_value('INFO') } - it { should contain_swift_proxy_config('DEFAULT/log_headers').with_value('False') } + it { should contain_swift_proxy_config('DEFAULT/log_headers').with_value('') } it { should contain_swift_proxy_config('DEFAULT/log_address').with_value('/dev/log') } it { should contain_swift_proxy_config('DEFAULT/log_udp_host').with_value('') } it { should contain_swift_proxy_config('DEFAULT/log_udp_port').with_value('') } @@ -126,6 +126,7 @@ describe 'swift::proxy' do :allow_account_management => false, :account_autocreate => false, :log_level => 'DEBUG', + :log_headers => false, :log_name => 'swift-proxy-server', :object_chunk_size => '8192', :client_chunk_size => '8192', @@ -148,7 +149,7 @@ describe 'swift::proxy' do it { should contain_swift_proxy_config('DEFAULT/log_name').with_value('swift-proxy-server') } it { should contain_swift_proxy_config('DEFAULT/log_facility').with_value('LOG_LOCAL2') } it { should contain_swift_proxy_config('DEFAULT/log_level').with_value('DEBUG') } - it { should contain_swift_proxy_config('DEFAULT/log_headers').with_value('False') } + it { should contain_swift_proxy_config('DEFAULT/log_headers').with_value(false) } it { should contain_swift_proxy_config('DEFAULT/log_address').with_value('/dev/log') } it { should contain_swift_proxy_config('DEFAULT/cors_allow_origin').with_value('http://foo.bar:1234,https://foo.bar') } it { should contain_swift_proxy_config('DEFAULT/strict_cors_mode').with_value('true') } @@ -211,7 +212,7 @@ describe 'swift::proxy' do it { should contain_swift_proxy_config('DEFAULT/log_name').with_value('swift-proxy-server') } it { should contain_swift_proxy_config('DEFAULT/log_facility').with_value('LOG_LOCAL2') } it { should contain_swift_proxy_config('DEFAULT/log_level').with_value('DEBUG') } - it { should contain_swift_proxy_config('DEFAULT/log_headers').with_value('False') } + it { should contain_swift_proxy_config('DEFAULT/log_headers').with_value('') } it { should contain_swift_proxy_config('DEFAULT/log_address').with_value('/dev/log') } it { should contain_swift_proxy_config('DEFAULT/log_udp_host').with_value('127.0.0.1') } it { should contain_swift_proxy_config('DEFAULT/log_udp_port').with_value('514') }