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

git at icinga.org git at icinga.org
Fri Oct 14 10:57:22 CEST 2016


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

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 2d3b240..ad19942 100644
--- a/library/Director/Objects/IcingaObject.php
+++ b/library/Director/Objects/IcingaObject.php
@@ -1898,8 +1898,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