[icinga-checkins] icinga.org: icingaweb2-module-director/master: Allow override of blacklisted properties

git at icinga.org git at icinga.org
Thu Aug 4 17:07:57 CEST 2016


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

Author: Corentin Ardeois <cardeois at iweb.com>
Date:   Thu Aug  4 11:03:50 2016 -0400

Allow override of blacklisted properties

It is now a separate class attribute which can be overridden.

---

 library/Director/Objects/IcingaObject.php |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php
index 9034b95..6a04a1c 100644
--- a/library/Director/Objects/IcingaObject.php
+++ b/library/Director/Objects/IcingaObject.php
@@ -61,6 +61,12 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
     // Will be rendered first, before imports
     protected $prioritizedProperties = array();
 
+    protected $propertiesNotForRendering = array(
+        'id',
+        'object_name',
+        'object_type',
+    );
+
     /**
      * Array of interval property names
      *
@@ -1278,11 +1284,7 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
     protected function renderProperties()
     {
         $out = '';
-        $blacklist = array_merge(array(
-            'id',
-            'object_name',
-            'object_type',
-        ), $this->prioritizedProperties);
+        $blacklist = array_merge($this->propertiesNotForRendering, $this->prioritizedProperties);
 
         foreach ($this->properties as $key => $value) {
             if (in_array($key, $blacklist)) {



More information about the icinga-checkins mailing list