KVM test: kvm_preprocessing.py: simplify pre/post_command error handling
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@redhat.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@4648 592f7852-d20e-0410-864c-8624ca9c26a4
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 @@
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):
"""