[icinga-checkins] icinga.org: icingaweb2-module-director/feature/icinga-legacy-config-13049: IcingaHostGroup(Legacy): Load zones prefetched

git at icinga.org git at icinga.org
Mon Nov 28 18:11:04 CET 2016


Module: icingaweb2-module-director
Branch: feature/icinga-legacy-config-13049
Commit: 060cc8f2a9e283a3f78291bd0aa29ef81fc3141e
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=060cc8f2a9e283a3f78291bd0aa29ef81fc3141e

Author: Markus Frosch <markus.frosch at icinga.com>
Date:   Tue Nov 15 16:36:48 2016 +0100

IcingaHostGroup(Legacy): Load zones prefetched

refs #13049

---

 library/Director/Objects/IcingaHostGroup.php |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/library/Director/Objects/IcingaHostGroup.php b/library/Director/Objects/IcingaHostGroup.php
index be5f855..148559e 100644
--- a/library/Director/Objects/IcingaHostGroup.php
+++ b/library/Director/Objects/IcingaHostGroup.php
@@ -61,10 +61,9 @@ class IcingaHostGroup extends IcingaObjectGroup
 
             // make sure we write to all zones
             // so host -> group relations are still possible
-            foreach (IcingaZone::loadAll($conn) as $zone) {
-                $zoneId = $zone->getAutoincId();
-                if (! array_key_exists($zoneId, $zoneMap)) {
-                    $zoneMap[$zoneId] = array();
+            foreach (IcingaObject::loadAllByType('zone', $conn) as $zone) {
+                if (! array_key_exists($zone->id, $zoneMap)) {
+                    $zoneMap[$zone->id] = array();
                 }
             }
 



More information about the icinga-checkins mailing list