From patchwork Wed Jun 10 12:32:46 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 29285 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 n5ACWq41027463 for ; Wed, 10 Jun 2009 12:32:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758439AbZFJMcr (ORCPT ); Wed, 10 Jun 2009 08:32:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758382AbZFJMcr (ORCPT ); Wed, 10 Jun 2009 08:32:47 -0400 Received: from mx1.redhat.com ([66.187.233.31]:43757 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757875AbZFJMcq (ORCPT ); Wed, 10 Jun 2009 08:32:46 -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 n5ACWl0h028849; Wed, 10 Jun 2009 08:32:47 -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 n5ACWkmR022863; Wed, 10 Jun 2009 08:32:46 -0400 Date: Wed, 10 Jun 2009 08:32:46 -0400 (EDT) From: Michael Goldish To: Lucas Meneghel Rodrigues Cc: kvm@vger.kernel.org, autotest@test.kernel.org Message-ID: <863506656.1664711244637166016.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> In-Reply-To: <1244565209-9132-3-git-send-email-lmr@redhat.com> Subject: Re: [KVM-AUTOTEST PATCH 3/4] Fix bad line breaks MIME-Version: 1.0 X-Originating-IP: [10.5.5.72] 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 Looks fine to me. ----- Original Message ----- From: "Lucas Meneghel Rodrigues" To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, "Lucas Meneghel Rodrigues" Sent: Tuesday, June 9, 2009 7:33:28 PM (GMT+0200) Auto-Detected Subject: [KVM-AUTOTEST PATCH 3/4] Fix bad line breaks During the conversion of the kvm_runtest_2 to the kvm test, some bad line breaks were introduced. Started using parenthesis implicit line continuation instead of backslash continuation in assignments that were using it. Signed-off-by: Lucas Meneghel Rodrigues --- client/tests/kvm/kvm_guest_wizard.py | 8 ++++---- client/tests/kvm/kvm_tests.py | 4 ++-- client/tests/kvm/kvm_utils.py | 12 ++++++------ client/tests/kvm/kvm_vm.py | 4 ++-- client/tests/kvm/make_html_report.py | 6 ++---- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/client/tests/kvm/kvm_guest_wizard.py b/client/tests/kvm/kvm_guest_wizard.py index 01aeb97..2dd9be5 100644 --- a/client/tests/kvm/kvm_guest_wizard.py +++ b/client/tests/kvm/kvm_guest_wizard.py @@ -105,8 +105,8 @@ def barrier_2(vm, words, fail_if_stuck_for, stuck_detection_history, time.sleep(sleep_duration) # Failure - message = "Barrier failed at step %s after %.2f seconds (%s)" % \ - (current_step_num, time.time() - start_time, failure_message) + message = ("Barrier failed at step %s after %.2f seconds (%s)" % + (current_step_num, time.time() - start_time, failure_message)) # What should we do with this failure? if words[-1] == "optional": @@ -201,9 +201,9 @@ def run_steps(test, params, env): logging.error("Variable not defined: %s" % words[1]) elif words[0] == "barrier_2": if current_screendump: - scrdump_filename = \ + scrdump_filename = ( os.path.join(ppm_utils.get_data_dir(steps_filename), - current_screendump) + current_screendump)) else: scrdump_filename = None if not barrier_2(vm, words, fail_if_stuck_for, diff --git a/client/tests/kvm/kvm_tests.py b/client/tests/kvm/kvm_tests.py index cccc48e..54d2a7a 100644 --- a/client/tests/kvm/kvm_tests.py +++ b/client/tests/kvm/kvm_tests.py @@ -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/kvm_utils.py b/client/tests/kvm/kvm_utils.py index 434190d..0f4c770 100644 --- a/client/tests/kvm/kvm_utils.py +++ b/client/tests/kvm/kvm_utils.py @@ -644,8 +644,8 @@ def scp_to_remote(host, port, username, password, local_path, remote_path, @return: True on success and False on failure. """ - command = "scp -o UserKnownHostsFile=/dev/null -r -P %s %s %s@%s:%s" % \ - (port, local_path, username, host, remote_path) + command = ("scp -o UserKnownHostsFile=/dev/null -r -P %s %s %s@%s:%s" % + (port, local_path, username, host, remote_path)) return remote_scp(command, password, timeout) @@ -664,8 +664,8 @@ def scp_from_remote(host, port, username, password, remote_path, local_path, @return: True on success and False on failure. """ - command = "scp -o UserKnownHostsFile=/dev/null -r -P %s %s@%s:%s %s" % \ - (port, username, host, remote_path, local_path) + command = ("scp -o UserKnownHostsFile=/dev/null -r -P %s %s@%s:%s %s" % + (port, username, host, remote_path, local_path)) return remote_scp(command, password, timeout) @@ -681,8 +681,8 @@ def ssh(host, port, username, password, prompt, timeout=10): @return: kvm_spawn object on success and None on failure. """ - command = "ssh -o UserKnownHostsFile=/dev/null -p %s %s@%s" % \ - (port, username, host) + command = ("ssh -o UserKnownHostsFile=/dev/null -p %s %s@%s" % + (port, username, host)) return remote_login(command, password, prompt, "\n", timeout) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index eb9717b..de21b2f 100644 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm/kvm_vm.py @@ -118,8 +118,8 @@ class VM: # Find available monitor filename while True: # The monitor filename should be unique - self.instance = time.strftime("%Y%m%d-%H%M%S-") + \ - kvm_utils.generate_random_string(4) + self.instance = (time.strftime("%Y%m%d-%H%M%S-") + + kvm_utils.generate_random_string(4)) self.monitor_file_name = os.path.join("/tmp", "monitor-" + self.instance) if not os.path.exists(self.monitor_file_name): diff --git a/client/tests/kvm/make_html_report.py b/client/tests/kvm/make_html_report.py index 6aed39e..7fb54e5 100755 --- a/client/tests/kvm/make_html_report.py +++ b/client/tests/kvm/make_html_report.py @@ -1442,10 +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']