From: Ondrej Lichtner <olichtne(a)redhat.com>
Indenting empty lines doesn't make sense so they should be skipped. This
also caused problems with strings that were terminated with a new line -
nesting PerfRepo objects were incorrectly formatted when printed.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Common/Utils.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lnst/Common/Utils.py b/lnst/Common/Utils.py
index c2fabd1..501c81f 100644
--- a/lnst/Common/Utils.py
+++ b/lnst/Common/Utils.py
@@ -296,7 +296,10 @@ def is_installed(program):
def indent(string, spaces):
ret_str = []
for line in string.split('\n'):
- ret_str.append(' '*spaces + line)
+ if line == "":
+ ret_str.append(line)
+ else:
+ ret_str.append(' '*spaces + line)
return '\n'.join(ret_str)
class Noop(object):
--
2.6.2