Skip to content

Commit

Permalink
Merge pull request #742 from Icinga/fix/query-objects
Browse files Browse the repository at this point in the history
fix test of empty array for environments parameter in query_objects
  • Loading branch information
lbetz committed Sep 19, 2023
2 parents ff882b7 + 3143976 commit 95b1664
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions manifests/query_objects.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
String $destination = $facts['networking']['fqdn'],
Array[String] $environments = [$environment],
) {
$_environments = ($environments.size == 0) ? {
true => '',
default => sprintf("environment in ['%s'] and", join($environments, "','")),
$_environments = if empty($environments) {
''
} else {
sprintf("environment in ['%s'] and", join($environments, "','"))
}

case $facts['os']['family'] {
Expand Down

0 comments on commit 95b1664

Please sign in to comment.