IcingaObjectMultiRelations: fix service relations

...for sets
This commit is contained in:
Thomas Gelf 2016-10-12 09:11:05 +00:00
parent 34ed3da3b8
commit 0a26b94e7c
1 changed files with 9 additions and 1 deletions

View File

@ -186,7 +186,15 @@ class IcingaObjectMultiRelations implements Iterator, Countable, IcingaConfigRen
$connection = $this->object->getConnection();
try {
$relation = $class::load($relation, $connection);
// Related services can only be objects, used by ServiceSets
if ($class === 'Icinga\\Module\\Director\\Objects\\IcingaService') {
$relation = $class::load(array(
'object_name' => $relation,
'object_type' => 'template'
), $connection);
} else {
$relation = $class::load($relation, $connection);
}
} catch (Exception $e) {
switch ($onError) {