[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
Wed Oct 19 13:17:42 CEST 2016


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

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