diff mbox

[KVM-AUTOTEST,10/12] KVM test: kvm_utils.py: small fix for format_str_for_message()

Message ID 9d3f23dc691330c08a1aa0e90455ffaac645777f.1249257056.git.mgoldish@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael Goldish Aug. 2, 2009, 11:58 p.m. UTC
format_str_for_message() sometimes adds an extra newline.  Fix that.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/kvm_utils.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py
index 5d8291f..1c11fa4 100644
--- a/client/tests/kvm/kvm_utils.py
+++ b/client/tests/kvm/kvm_utils.py
@@ -654,7 +654,9 @@  def format_str_for_message(str):
 
     @param str: string that will be formatted.
     """
-    num_lines = len(str.splitlines())
+    lines = str.splitlines()
+    num_lines = len(lines)
+    str = "\n".join(lines)
     if num_lines == 0:
         return ""
     elif num_lines == 1: