예제 #1
0
파일: callbacks.py 프로젝트: Silaco/Plus
 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))
예제 #2
0
파일: callbacks.py 프로젝트: Silaco/Plus
 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)