[icinga-checkins] icinga.org: icingaweb2-module-director/master: IcingaArguments: play nice with DSL in set_if

git at icinga.org git at icinga.org
Mon Feb 1 15:07:53 CET 2016


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

Author: Thomas Gelf <thomas at gelf.net>
Date:   Mon Feb  1 15:07:02 2016 +0100

IcingaArguments: play nice with DSL in set_if

Recent changes to ITL ships with such an example.

---

 library/Director/Objects/IcingaArguments.php |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/library/Director/Objects/IcingaArguments.php b/library/Director/Objects/IcingaArguments.php
index 76c8ab8..bd567a9 100644
--- a/library/Director/Objects/IcingaArguments.php
+++ b/library/Director/Objects/IcingaArguments.php
@@ -135,6 +135,12 @@ class IcingaArguments implements Iterator, Countable, IcingaConfigRenderer
             }
         }
 
+        if (array_key_exists('set_if', $attrs) && is_object($attrs['set_if'])) {
+            if ($attrs['set_if']->type === 'Function') {
+                $attrs['set_if'] = '/* Unable to fetch function body through API */';
+                $attrs['set_if_format'] = 'expression';
+            }
+        }
 
         $this->add(IcingaCommandArgument::create($attrs));
 



More information about the icinga-checkins mailing list