KVM test: Replace some kvm_subprocess usage with utils.system

The preprocessing command and qemu-img command are
currently ran using kvm_subprocess. However, those
commands have no need to use that API, considering
that we don't need to interact with those commands
or make them persist between tests.

Using utils.system() instead of kvm_subprocess
speeds up the command execution, and simplifies
the code a bit.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4212 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py
index 53fa2cb..8a0c151 100644
--- a/client/tests/kvm/kvm_preprocessing.py
+++ b/client/tests/kvm/kvm_preprocessing.py
@@ -1,5 +1,5 @@
 import sys, os, time, commands, re, logging, signal, glob
-from autotest_lib.client.bin import test
+from autotest_lib.client.bin import test, utils
 from autotest_lib.client.common_lib import error
 import kvm_vm, kvm_utils, kvm_subprocess, ppm_utils
 try:
@@ -142,17 +142,14 @@
     for k in params.keys():
         os.putenv("KVM_TEST_%s" % k, str(params[k]))
     # Execute command
-    logging.info("Executing command '%s'..." % command)
-    (status, output) = kvm_subprocess.run_fg("cd %s; %s" % (test.bindir,
-                                                            command),
-                                             logging.debug, "(command) ",
-                                             timeout=command_timeout)
-    if status != 0:
-        logging.warn("Custom processing command failed: '%s'; Output is: %s" %
-                                                            (command, output))
+    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" %
-                                                                   output)
+                                  str(e))
 
 
 def process(test, params, env, image_func, vm_func):