[icinga-checkins] icinga.org: icingaweb2-module-director/feature/icinga1-config-12919: IcingaObject(legacy): Fix alignLegacyProperties for long attributes

git at icinga.org git at icinga.org
Thu Oct 27 15:47:40 CEST 2016


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

Author: Markus Frosch <markus.frosch at icinga.com>
Date:   Thu Oct 27 15:44:36 2016 +0200

IcingaObject(legacy): Fix alignLegacyProperties for long attributes

refs #12919

---

 library/Director/Objects/IcingaObject.php |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php
index 959e627..12c0f84 100644
--- a/library/Director/Objects/IcingaObject.php
+++ b/library/Director/Objects/IcingaObject.php
@@ -2035,11 +2035,13 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
         foreach ($lines as &$line) {
             if (preg_match('/^\s{4}([^\t]+)\t+(.+)$/', $line, $m)) {
                 if ($len - strlen($m[1]) < 0) {
-                    var_dump($m);
-                    exit;
+                    $fill = ' ';
+                }
+                else {
+                    $fill = str_repeat(' ', $len - strlen($m[1]));
                 }
 
-                $line = '    ' . $m[1] . str_repeat(' ', $len - strlen($m[1])) . $m[2];
+                $line = '    ' . $m[1] . $fill . $m[2];
             }
         }
 



More information about the icinga-checkins mailing list