IcingaNotification: deal with missing vars

This commit is contained in:
Thomas Gelf 2022-12-28 11:04:13 +01:00
parent ccc3e510a6
commit 881eba7298

View File

@ -119,10 +119,13 @@ class IcingaNotification extends IcingaObject implements ExportInterface
. c::renderKeyOperatorValue($property, '+=', "service.vars$varSuffix", $indent . ' ')
. "$indent} else {\n"
. $this->getHostSnippet($indent . ' ')
. c::renderKeyOperatorValue($property, '+=', "host.vars$varSuffix", $indent . ' ')
. "$indent if (host.vars$varSuffix) { "
. c::renderKeyOperatorValue($property, '+=', "host.vars$varSuffix }", '')
. "$indent}\n";
} elseif ($objectType === 'host') {
return $this->getHostSnippet() . c::renderKeyOperatorValue($property, '+=', "host.vars$varSuffix");
return $this->getHostSnippet()
. "{$indent}if (host.vars$varSuffix) { "
. c::renderKeyOperatorValue($property, '+=', "host.vars$varSuffix }");
}
return '';