[KVM-AUTOTEST PATCH 07/18] KVM test: kvm_preprocessing.py: simplify pre/post_command error handling

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

 



Currently the error message appears twice: both in a logging.warn() statement
and in an exception.  Also the error.TestError raised adds unnecessary text to
the exception message, which is informative enough as it is.

Signed-off-by: Michael Goldish <mgoldish@xxxxxxxxxx>
---
 client/tests/kvm/kvm_preprocessing.py |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py
index 84ad7c5..1ed4ec2 100644
--- a/client/tests/kvm/kvm_preprocessing.py
+++ b/client/tests/kvm/kvm_preprocessing.py
@@ -162,12 +162,10 @@ def process_command(test, params, env, command, command_timeout,
     try:
         utils.system("cd %s; %s" % (test.bindir, command))
     except error.CmdError, e:
-        logging.warn("Custom processing command '%s' failed, output is: %s",
-                     command, str(e))
-        if not command_noncritical:
-            raise error.TestError("Custom processing command failed: %s" %
-                                  str(e))
-
+        if command_noncritical:
+            logging.warn(e)
+        else:
+            raise
 
 def process(test, params, env, image_func, vm_func):
     """
-- 
1.5.4.1

--
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