[icinga-checkins] icinga.org: icingaweb2-module-director/master: IcingaConfigHelper: allow to render key/op/value

git at icinga.org git at icinga.org
Mon Feb 29 20:39:05 CET 2016


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

Author: Thomas Gelf <thomas at gelf.net>
Date:   Mon Feb 29 17:36:12 2016 +0100

IcingaConfigHelper: allow to render key/op/value

---

 library/Director/IcingaConfig/IcingaConfigHelper.php |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/library/Director/IcingaConfig/IcingaConfigHelper.php b/library/Director/IcingaConfig/IcingaConfigHelper.php
index de095c3..2894939 100644
--- a/library/Director/IcingaConfig/IcingaConfigHelper.php
+++ b/library/Director/IcingaConfig/IcingaConfigHelper.php
@@ -39,9 +39,15 @@ class IcingaConfigHelper
 
     public static function renderKeyValue($key, $value, $prefix = '    ')
     {
+        return self::renderKeyOperatorValue($key, '=', $value, $prefix);
+    }
+
+    public static function renderKeyOperatorValue($key, $operator, $value, $prefix = '    ')
+    {
         $string = sprintf(
-            "%s = %s",
+            "%s %s %s",
             $key,
+            $operator,
             $value
         );
 



More information about the icinga-checkins mailing list