IcingaObject(Legacy): Render check_command when inherited, but ARGn is set

refs #12919
This commit is contained in:
Markus Frosch 2016-11-03 14:16:07 +01:00
parent 1d7cfa343e
commit 199a46abcb
1 changed files with 15 additions and 2 deletions

View File

@ -1984,7 +1984,7 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
}
}
array_unshift($args, $this->get('check_command'));
array_unshift($args, $value);
return c1::renderKeyValue('check_command', join('!', $args));
}
@ -2009,7 +2009,20 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
protected function renderLegacyCustomExtensions()
{
return '';
$str = '';
// force rendering of check_command when ARG1 is set
if ($this->supportsCustomVars() && array_key_exists('check_command_id', $this->defaultProperties)) {
if (
$this->vars()->get('ARG1') !== null
&& $this->get('check_command') === null
) {
$command = $this->getResolvedRelated('check_command');
$str .= $this->renderLegacyCheck_command($command->getObjectName());
}
}
return $str;
}
protected function renderObjectHeader()