[icinga-checkins] icinga.org: icingaweb2-module-director/feature/icinga1-config-12919: IcingaObject(Legacy): Render legacy customvars

git at icinga.org git at icinga.org
Fri Oct 14 12:01:03 CEST 2016


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

Author: Markus Frosch <markus.frosch at icinga.com>
Date:   Fri Oct 14 11:53:26 2016 +0200

IcingaObject(Legacy): Render legacy customvars

refs #12919

---

 library/Director/Objects/IcingaObject.php |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php
index 7bc14db..0698f4c 100644
--- a/library/Director/Objects/IcingaObject.php
+++ b/library/Director/Objects/IcingaObject.php
@@ -1734,6 +1734,18 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
     /**
      * @return string
      */
+    protected function renderLegacyCustomVars()
+    {
+        if ($this->supportsCustomVars()) {
+            return $this->vars()->toLegacyConfigString();
+        } else {
+            return '';
+        }
+    }
+
+    /**
+     * @return string
+     */
     protected function renderGroups()
     {
         if ($this->supportsGroups()) {
@@ -1902,7 +1914,7 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
             $this->renderLegacyGroups(),
             //$this->renderMultiRelations(),
             //$this->renderCustomExtensions(),
-            //$this->renderCustomVars(),
+            $this->renderLegacyCustomVars(),
             //$this->renderAssignments(),
             $this->renderLegacySuffix()
         ));



More information about the icinga-checkins mailing list