Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(bugfix) backend: dont log warnings if not necessary #449

Merged
merged 1 commit into from
Nov 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions manifests/backend.pp
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,23 @@

# See https://github.com/puppetlabs/puppetlabs-haproxy/pull/442 - when using the option 'httpchk', it must be positioned
# before the 'http-check' directive in haproxy.cfg otherwise it will be ignored
if $options.is_hash and has_key($options, 'option') {
if ('httpchk' in $options['option']) {
warning('Overriding the value of $sort_options_alphabetic to "false" due to "httpchk" option defined')
$_sort_options_alphabetic = false
}
#
# logic:
# 1) if alphabetic sorting is explicitly disabled, accept that
# 2) if the options hash contains httpchk, disable alphabetic sorting *and* log a warning
# 3) use whats provides to this module and if that's undef, use the module default
$picked_sort_options_alphabetic = pick($sort_options_alphabetic, $haproxy::globals::sort_options_alphabetic)
if $picked_sort_options_alphabetic == false {
$_sort_options_alphabetic = $picked_sort_options_alphabetic
} else {
$_sort_options_alphabetic = pick($sort_options_alphabetic, $haproxy::globals::sort_options_alphabetic)
if $options.is_hash and has_key($options, 'option') {
if ('httpchk' in $options['option']) {
warning('Overriding the value of $sort_options_alphabetic to "false" due to "httpchk" option defined')
$_sort_options_alphabetic = false
}
} else {
$_sort_options_alphabetic = $picked_sort_options_alphabetic
}
}

if $defaults == undef {
Expand Down