[icinga-checkins] icinga.org: icingaweb2-module-director/master: IcingaObject(Legacy): Properly comment a disabled object

git at icinga.org git at icinga.org
Thu Nov 3 14:23:22 CET 2016


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

Author: Markus Frosch <markus.frosch at icinga.com>
Date:   Fri Oct 14 10:25:03 2016 +0200

IcingaObject(Legacy): Properly comment a disabled object

refs #12919

---

 library/Director/Objects/IcingaObject.php |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php
index 390f38d..c59f310 100644
--- a/library/Director/Objects/IcingaObject.php
+++ b/library/Director/Objects/IcingaObject.php
@@ -2019,8 +2019,10 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
         $str = $this->alignLegacyProperties($str);
 
         if ($this->isDisabled()) {
-            return "/* --- This object has been disabled ---\n"
-                . $str . "*/\n";
+            return
+                "# --- This object has been disabled ---\n"
+                . preg_replace('~^~m', '# ', trim($str))
+                . "\n";
         } else {
             return $str;
         }



More information about the icinga-checkins mailing list