Commit 2fedeb98 authored by ibuler's avatar ibuler

[Update] 修改命令错误输出

parent daadcedc
...@@ -178,7 +178,13 @@ class CommandResultCallback(AdHocResultCallback): ...@@ -178,7 +178,13 @@ class CommandResultCallback(AdHocResultCallback):
def v2_runner_on_failed(self, result, ignore_errors=False): def v2_runner_on_failed(self, result, ignore_errors=False):
self.results_summary['success'] = False self.results_summary['success'] = False
self.gather_result("failed", result) self.gather_result("failed", result)
msg = result._result.get("msg") or result._result.get("module_stdout") msg = result._result.get("msg", '')
stderr = result._result.get("stderr")
if stderr:
msg += '\n' + stderr
module_stdout = result._result.get("module_stdout")
if module_stdout:
msg += '\n' + module_stdout
if not msg: if not msg:
msg = json.dumps(result._result, indent=4) msg = json.dumps(result._result, indent=4)
self._display.display("%s | FAILED! => \n%s" % ( self._display.display("%s | FAILED! => \n%s" % (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment