Skip to content

Commit 06f76c2

Browse files
spectralblutruthbk
authored andcommitted
Silence agent6_extra_options notification on default params (#449)
* Silence agent6_extra_options notification on default params * Add specs to check for extraneous notifys
1 parent d166438 commit 06f76c2

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

manifests/init.pp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,16 +534,16 @@
534534
}
535535
} else {
536536
# notify of broken params on agent6
537-
if $proxy_host {
537+
if !empty($proxy_host) {
538538
notify { 'Setting proxy_host will have no effect on agent6 please use agent6_extra_options to set your proxy': }
539539
}
540-
if $_proxy_port {
540+
if !empty($_proxy_port) {
541541
notify { 'Setting proxy_port will have no effect on agent6 please use agent6_extra_options to set your proxy': }
542542
}
543-
if $proxy_user {
543+
if !empty($proxy_user) {
544544
notify { 'Setting proxy_user will have no effect on agent6 please use agent6_extra_options to set your proxy': }
545545
}
546-
if $proxy_password {
546+
if !empty($proxy_password) {
547547
notify { 'Setting proxy_password will have no effect on agent6 please use agent6_extra_options to set your proxy': }
548548
}
549549

spec/classes/datadog_agent_spec.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,26 @@
979979
'Setting proxy_password will have no effect on agent6 please use agent6_extra_options to set your proxy')
980980
}
981981
end
982+
context 'deprecated proxy settings with default values' do
983+
let(:params) {{
984+
:proxy_host => '',
985+
:proxy_port => '',
986+
:proxy_user => '',
987+
:proxy_password => '',
988+
}}
989+
it { is_expected.not_to contain_notify(
990+
'Setting proxy_host will have no effect on agent6 please use agent6_extra_options to set your proxy')
991+
}
992+
it { is_expected.not_to contain_notify(
993+
'Setting proxy_port will have no effect on agent6 please use agent6_extra_options to set your proxy')
994+
}
995+
it { is_expected.not_to contain_notify(
996+
'Setting proxy_user will have no effect on agent6 please use agent6_extra_options to set your proxy')
997+
}
998+
it { is_expected.not_to contain_notify(
999+
'Setting proxy_password will have no effect on agent6 please use agent6_extra_options to set your proxy')
1000+
}
1001+
end
9821002
end
9831003

9841004
context 'with additional agents config' do

0 commit comments

Comments
 (0)