From a495a6ca397f7182f293df783caebfd377d42d18 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sun, 13 Aug 2017 23:18:54 +0200 Subject: [PATCH] IcingaObjectImports: use new repository for lookup --- library/Director/Objects/IcingaObjectImports.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/library/Director/Objects/IcingaObjectImports.php b/library/Director/Objects/IcingaObjectImports.php index 4e8ffa6c..388fa2c0 100644 --- a/library/Director/Objects/IcingaObjectImports.php +++ b/library/Director/Objects/IcingaObjectImports.php @@ -9,6 +9,7 @@ use Iterator; use Icinga\Module\Director\IcingaConfig\IcingaConfigHelper as c; use Icinga\Module\Director\IcingaConfig\IcingaConfigRenderer; use Icinga\Module\Director\IcingaConfig\IcingaLegacyConfigHelper as c1; +use Icinga\Module\Director\Repository\IcingaTemplateRepository; class IcingaObjectImports implements Iterator, Countable, IcingaConfigRenderer { @@ -169,7 +170,7 @@ class IcingaObjectImports implements Iterator, Countable, IcingaConfigRenderer protected function refreshIndex() { $this->idx = array_keys($this->imports); - $this->object->templateResolver()->refreshObject($this->object); + // $this->object->templateResolver()->refreshObject($this->object); return $this; } @@ -271,8 +272,9 @@ class IcingaObjectImports implements Iterator, Countable, IcingaConfigRenderer protected function loadFromDb() { - $resolver = $this->object->templateResolver(); - $this->objects = $resolver->fetchParents(); + // $resolver = $this->object->templateResolver(); + // $this->objects = $resolver->fetchParents(); + $this->objects = IcingaTemplateRepository::instanceByObject($this->object)->getTemplatesFor($this->object); if (empty($this->objects)) { $this->imports = array(); } else {