[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 15:36:26 CEST 2016


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

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 521eadc..d3265fa 100644
--- a/library/Director/Objects/IcingaObject.php
+++ b/library/Director/Objects/IcingaObject.php
@@ -1947,8 +1947,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