[icinga-checkins] icinga.org: icingaweb2-module-director/feature/icinga1-config-12919: IcingaObject(legacy): Only render passive objects for checkables

git at icinga.org git at icinga.org
Thu Oct 13 15:28:09 CEST 2016


Module: icingaweb2-module-director
Branch: feature/icinga1-config-12919
Commit: 78d537576e8948a856f30a5bd863203d6806e241
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=78d537576e8948a856f30a5bd863203d6806e241

Author: Markus Frosch <markus.frosch at icinga.com>
Date:   Thu Oct 13 15:22:15 2016 +0200

IcingaObject(legacy): Only render passive objects for checkables

refs #12919

---

 library/Director/Objects/IcingaObject.php |   19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php
index 6f0f0d7..60304e3 100644
--- a/library/Director/Objects/IcingaObject.php
+++ b/library/Director/Objects/IcingaObject.php
@@ -1346,21 +1346,22 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
 
             if ($this->getResolvedProperty('zone_id')) {
 
-                $a = clone($this);
-                $a->enable_active_checks = true;
+            if ($this->getResolvedProperty('zone_id')) {
 
-                $b = clone($this);
-                $a->enable_active_checks = false;
+                if (array_key_exists('enable_active_checks', $this->defaultProperties)) {
+                    $passive = clone($this);
+                    $passive->enable_active_checks = false;
 
-                $config->configFile(
-                    'director/master/' . $filename,
-                    '.cfg'
-                )->addLegacyObject($a);
+                    $config->configFile(
+                        'director/master/' . $filename,
+                        '.cfg'
+                    )->addLegacyObject($passive);
+                }
 
                 $config->configFile(
                     'director/' . $this->getRenderingZone($config) . '/' . $filename,
                     '.cfg'
-                )->addLegacyObject($b);
+                )->addLegacyObject($this);
 
             } else {
                 $config->configFile(



More information about the icinga-checkins mailing list