IcingaArguments: play nice with DSL in set_if

Recent changes to ITL ships with such an example.
This commit is contained in:
Thomas Gelf 2016-02-01 15:07:02 +01:00
parent c6c8b75c74
commit 9786fd5dae
1 changed files with 6 additions and 0 deletions

View File

@ -135,6 +135,12 @@ class IcingaArguments implements Iterator, Countable, IcingaConfigRenderer
}
}
if (array_key_exists('set_if', $attrs) && is_object($attrs['set_if'])) {
if ($attrs['set_if']->type === 'Function') {
$attrs['set_if'] = '/* Unable to fetch function body through API */';
$attrs['set_if_format'] = 'expression';
}
}
$this->add(IcingaCommandArgument::create($attrs));