From patchwork Mon Jun 8 06:50:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 28557 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n586p627024951 for ; Mon, 8 Jun 2009 06:51:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751501AbZFHGvB (ORCPT ); Mon, 8 Jun 2009 02:51:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751493AbZFHGvB (ORCPT ); Mon, 8 Jun 2009 02:51:01 -0400 Received: from mx1.redhat.com ([66.187.233.31]:59604 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751482AbZFHGvA (ORCPT ); Mon, 8 Jun 2009 02:51:00 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n586p1s7005620; Mon, 8 Jun 2009 02:51:01 -0400 Received: from mail05.corp.redhat.com (zmail05.collab.prod.int.phx2.redhat.com [10.5.5.46]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n586ox11021038; Mon, 8 Jun 2009 02:51:00 -0400 Date: Mon, 8 Jun 2009 02:50:59 -0400 (EDT) From: Michael Goldish To: Lucas Meneghel Rodrigues Cc: kvm@vger.kernel.org, autotest@test.kernel.org Message-ID: <917366947.1401851244443859650.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> In-Reply-To: <1245786528.1401721244443593972.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Subject: Re: [Autotest] [PATCH 2/3] Fixing bad line breaks MIME-Version: 1.0 X-Originating-IP: [10.5.5.71] X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 1. Inside parentheses there is no need to fix anything. e.g. the following code is fine: logging.info("Copying %s.tar.bz2 to guest (file is missing or has a" " different size)..." % test_name) and also looks cleaner than the new version with the backslash and weird indentation. (I think it looks cleaner to have the space on the first line, i.e. logging.info("Copying %s.tar.bz2 to guest (file is missing or has a " "different size)..." % test_name) but that is just being petty.) 2. Outside parentheses, I think it's cleaner to use a backslash outside the quotes, and proper indentation, e.g. instead of: message_fail = "Test '%s' did not produce any recognizable \ results" % test_name consider: message_fail = "Test '%s' did not produce any recognizable " \ "results" % test_name or with 8 spaces -- I'm not sure what's better: message_fail = "Test '%s' did not produce any recognizable " \ "results" % test_name I think it's a good idea to use proper indentation also where no strings are involved -- instead of: stat_str = 'From %d tests executed, %d have passed (%d%% failures)' % \ (total_executed, total_passed, failed_perct) consider: stat_str = 'From %d tests executed, %d have passed (%d%% failures)' % \ (total_executed, total_passed, failed_perct) ^ | vim auto-indents by 8 spaces here, but I'm not sure what the convention is. I'm pretty sure indentation is a good idea though. Again, I'm sorry if I'm being petty. If I made a mistake understanding your patch or the conventions, please correct me. Thanks, Michael ----- Original Message ----- From: "Lucas Meneghel Rodrigues" To: autotest@test.kernel.org Cc: kvm@vger.kernel.org Sent: Monday, June 8, 2009 7:04:29 AM (GMT+0200) Auto-Detected Subject: [Autotest] [PATCH 2/3] Fixing bad line breaks During the conversion of logging statements, some bad line continuation were introduced. This patch fixes the mistakes. Signed-off-by: Lucas Meneghel Rodrigues --- client/tests/kvm/kvm_tests.py | 12 ++++++------ client/tests/kvm/make_html_report.py | 5 ++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/client/tests/kvm/kvm_tests.py b/client/tests/kvm/kvm_tests.py index cccc48e..9adea6f 100644 --- a/client/tests/kvm/kvm_tests.py +++ b/client/tests/kvm/kvm_tests.py @@ -274,8 +274,8 @@ def run_autotest(test, params, env): copy = True # Perform the copy if copy: - logging.info("Copying %s.tar.bz2 to guest (file is missing or has a" - " different size)..." % test_name) + logging.info("Copying %s.tar.bz2 to guest \ + (file is missing or has a different size)..." % test_name) if not vm.scp_to_remote(tarred_test_path, ""): raise error.TestFail("Could not copy %s.tar.bz2 to guest" % test_name) @@ -291,8 +291,8 @@ def run_autotest(test, params, env): # Extract .tar.bz2 into autotest/tests logging.info("Extracting %s.tar.bz2..." % test_name) - status = session.get_command_status("tar xvfj %s.tar.bz2 -C " - "autotest/tests" % test_name) + status = session.get_command_status("tar xvfj %s.tar.bz2 -C \ + autotest/tests" % test_name) if status != 0: raise error.TestFail("Could not extract %s.tar.bz2" % test_name) @@ -321,8 +321,8 @@ def run_autotest(test, params, env): status_fail = False if result_list == []: status_fail = True - message_fail = "Test '%s' did not produce any recognizable" - " results" % test_name + message_fail = "Test '%s' did not produce any recognizable \ + results" % test_name for result in result_list: logging.info(str(result)) if result[1] == "FAIL": diff --git a/client/tests/kvm/make_html_report.py b/client/tests/kvm/make_html_report.py index 6aed39e..5b2e579 100755 --- a/client/tests/kvm/make_html_report.py +++ b/client/tests/kvm/make_html_report.py @@ -1442,9 +1442,8 @@ return true; stat_str = 'No test cases executed' if total_executed>0: failed_perct = int(float(total_failed)/float(total_executed)*100) - stat_str = 'From %d tests executed, ' - '%d have passed (%d%s)' % (total_executed, total_passed,failed_perct, - '% failures') + stat_str = 'From %d tests executed, %d have passed (%d%% failures)' % \ + (total_executed, total_passed, failed_perct) kvm_ver_str = metadata['kvmver']