def _on_any(self, host, result): result2 = result.copy() result2.pop('invocation', None) (msg, color) = host_report_msg(host, self.options.module_name, result2, self.options.one_line) display(msg, color=color, runner=self.runner) if self.options.tree: utils.write_tree_file(self.options.tree, host, utils.jsonify(result2,format=True))
def on_unreachable(self, host, res): if type(res) == dict: res = res.get('msg', '') print "%s | FAILED => %s" % (host, res) if self.options.tree: utils.write_tree_file(self.options.tree, host, utils.bigjson(dict(failed=True, msg=res)))
def on_unreachable(self, host, res): if type(res) == dict: res = res.get("msg", "") display("%s | FAILED => %s" % (host, res), stderr=True, color="red", runner=self.runner) if self.options.tree: utils.write_tree_file(self.options.tree, host, utils.jsonify(dict(failed=True, msg=res), format=True)) super(CliRunnerCallbacks, self).on_unreachable(host, res)
def _on_any(self, host, result): result2 = result.copy() result2.pop('invocation', None) print host_report_msg(host, self.options.module_name, result2, self.options.one_line) if self.options.tree: utils.write_tree_file(self.options.tree, host, utils.jsonify(result2, format=True))
def on_unreachable(self, host, res): if type(res) == dict: res = res.get('msg', '') print "%s | FAILED => %s" % (host, res) if self.options.tree: utils.write_tree_file( self.options.tree, host, utils.jsonify(dict(failed=True, msg=res), format=True)) super(CliRunnerCallbacks, self).on_unreachable(host, res)
def on_unreachable(self, host, res): if type(res) == dict: res = res.get('msg','') print "%s | FAILED => %s" % (host, res) if self.options.tree: utils.write_tree_file( self.options.tree, host, utils.jsonify(dict(failed=True, msg=res),format=True) ) super(CliRunnerCallbacks, self).on_unreachable(host, res)
def on_unreachable(self, host, res): if type(res) == dict: res = res.get('msg', '') res = to_bytes(res) display("%s | FAILED => %s" % (host, res), stderr=True, color='red', runner=self.runner) if self.options.tree: utils.write_tree_file( self.options.tree, host, utils.jsonify(dict(failed=True, msg=res), format=True)) super(CliRunnerCallbacks, self).on_unreachable(host, res)
def on_unreachable(self, host, res): # 主机不可达的结果处理 if type(res) == dict: res = res.get('msg','') res = to_bytes(res) # 调用display函数将错误信息输入到标准错误输出 display("%s | FAILED => %s" % (host, res), stderr=True, color='red', runner=self.runner) # 如果通过 --tree 指定了日志输出目录,则调用write_tree_file方法将错误写到响应的以主机名为文件名的日志文件中 if self.options.tree: utils.write_tree_file( self.options.tree, host, utils.jsonify(dict(failed=True, msg=res),format=True) ) # 调用父类的on_unreachable方法 super(CliRunnerCallbacks, self).on_unreachable(host, res)
def on_unreachable(self, host, res): # 主机不可达的结果处理 if type(res) == dict: res = res.get('msg', '') res = to_bytes(res) # 调用display函数将错误信息输入到标准错误输出 display("%s | FAILED => %s" % (host, res), stderr=True, color='red', runner=self.runner) # 如果通过 --tree 指定了日志输出目录,则调用write_tree_file方法将错误写到响应的以主机名为文件名的日志文件中 if self.options.tree: utils.write_tree_file( self.options.tree, host, utils.jsonify(dict(failed=True, msg=res), format=True)) # 调用父类的on_unreachable方法 super(CliRunnerCallbacks, self).on_unreachable(host, res)
def _on_any(self, host, result): print utils.host_report_msg(host, self.options.module_name, result, self.options.one_line) if self.options.tree: utils.write_tree_file(self.options.tree, host, utils.bigjson(result))
def on_unreachable(self, host, res): if type(res) == dict: res = res.get('msg','') print "%s | FAILED => %s" % (host, res) if self.options.tree: utils.write_tree_file(self.options.tree, host, utils.bigjson(dict(failed=True, msg=res)))
def on_unreachable(self, host, res): print "%s | FAILED => %s" % (host, res) if self.options.tree: utils.write_tree_file(self.options.tree, host, utils.bigjson(dict(failed=True, msg=res)))
def _on_any(self, host, result): result2 = result.copy() result2.pop('invocation', None) print host_report_msg(host, self.options.module_name, result2, self.options.one_line) if self.options.tree: utils.write_tree_file(self.options.tree, host, utils.jsonify(result2,format=True))