[icinga-checkins] icinga.org: icingaweb2-module-director/master: IcingaObject: blacklist " disabled" when inheriting

git at icinga.org git at icinga.org
Sun Feb 28 17:12:40 CET 2016


Module: icingaweb2-module-director
Branch: master
Commit: 7d9fefd61f62febd3ee340ca1821184c18811586
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=7d9fefd61f62febd3ee340ca1821184c18811586

Author: Thomas Gelf <thomas at gelf.net>
Date:   Sun Feb 28 14:28:27 2016 +0100

IcingaObject: blacklist "disabled" when inheriting

---

 library/Director/Objects/IcingaObject.php |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php
index 6151358..f2fdfd9 100644
--- a/library/Director/Objects/IcingaObject.php
+++ b/library/Director/Objects/IcingaObject.php
@@ -497,7 +497,7 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
         $getInherited = 'getInherited' . $what;
         $getOrigins   = 'getOrigins'  . $what;
 
-        $blacklist = array('id', 'object_type', 'object_name');
+        $blacklist = array('id', 'object_type', 'object_name', 'disabled');
         foreach ($objects as $name => $object) {
             $origins = $object->$getOrigins();
 
@@ -512,8 +512,13 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
             }
 
             foreach ($object->$get() as $key => $value) {
-                if ($value === null) continue;
-                if (in_array($key, $blacklist)) continue;
+                // TODO: skip if default value?
+                if ($value === null) {
+                    continue;
+                }
+                if (in_array($key, $blacklist)) {
+                    continue;
+                }
                 $vals['_MERGED_']->$key = $value;
                 $vals['_INHERITED_']->$key = $value;
                 $vals['_ORIGINS_']->$key = $name;



More information about the icinga-checkins mailing list