[KVM-AUTOTEST PATCH 3/4] Fix bad line breaks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <lmr@xxxxxxxxxx>
---
 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']
 
-- 
1.6.2.2

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux