Merge "Generate pod.yaml from current context"
[yardstick.git] / yardstick / benchmark / scenarios / availability / monitor / monitor_command.py
index a0777f9..d0551bf 100644 (file)
@@ -11,7 +11,6 @@ from __future__ import absolute_import
 import os
 import logging
 import subprocess
-import traceback
 
 import yardstick.ssh as ssh
 from yardstick.benchmark.scenarios.availability.monitor import basemonitor
@@ -27,9 +26,7 @@ def _execute_shell_command(command):
         output = subprocess.check_output(command, shell=True)
     except Exception:
         exitcode = -1
-        output = traceback.format_exc()
-        LOG.error("exec command '%s' error:\n ", command)
-        LOG.error(traceback.format_exc())
+        LOG.error("exec command '%s' error:\n ", command, exc_info=True)
 
     return exitcode, output
 
@@ -66,6 +63,7 @@ class MonitorOpenstackCmd(basemonitor.BaseMonitor):
     def monitor_func(self):
         exit_status = 0
         exit_status, stdout = _execute_shell_command(self.cmd)
+        LOG.debug("Execute command '%s' and the stdout is:\n%s", self.cmd, stdout)
         if exit_status:
             return False
         return True