IcingaService: cosmetics, render single hosts...

...with equals, multiple ones as "in array"

refs #907
This commit is contained in:
Thomas Gelf 2018-05-25 19:48:27 +02:00
parent 409661f7d0
commit c3fd50003a
1 changed files with 11 additions and 4 deletions

View File

@ -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