From c3fd50003a62d91fb6776fcbb7e7541d6c777c18 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 25 May 2018 19:48:27 +0200 Subject: [PATCH] IcingaService: cosmetics, render single hosts... ...with equals, multiple ones as "in array" refs #907 --- library/Director/Objects/IcingaService.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/library/Director/Objects/IcingaService.php b/library/Director/Objects/IcingaService.php index f807a099..56588239 100644 --- a/library/Director/Objects/IcingaService.php +++ b/library/Director/Objects/IcingaService.php @@ -411,10 +411,17 @@ class IcingaService extends IcingaObject $blacklist = $this->getBlacklistedHostnames(); if (! empty($blacklist)) { - $output .= sprintf( - " ignore where host.name in %s\n", - c::renderArray($blacklist) - ); + if (count($blacklist) === 1) { + $output .= sprintf( + " ignore host.name == %s\n", + c::renderString($blacklist[0]) + ); + } else { + $output .= sprintf( + " ignore where host.name in %s\n", + c::renderArray($blacklist) + ); + } } // A hand-crafted command endpoint overrides use_agent