Browse Source

fix: 执行 ansible 任务日志记录错误

pull/7404/head
xinwen 3 years ago committed by 老广
parent
commit
93d77b2312
  1. 9
      apps/ops/ansible/display.py

9
apps/ops/ansible/display.py

@ -54,6 +54,9 @@ class AdHocDisplay(Display, metaclass=UnSingleton):
self.log_file.write(msg) self.log_file.write(msg)
def display(self, msg, color=None, stderr=False, screen_only=False, log_only=False, newline=True): def display(self, msg, color=None, stderr=False, screen_only=False, log_only=False, newline=True):
if log_only:
return
if color: if color:
msg = stringc(msg, color) msg = stringc(msg, color)
@ -62,7 +65,5 @@ class AdHocDisplay(Display, metaclass=UnSingleton):
else: else:
msg2 = msg msg2 = msg
if log_only: self._write_to_log_file(msg2)
self._write_to_log_file(msg2) self._write_to_screen(msg2, stderr)
else:
self._write_to_screen(msg2, stderr)

Loading…
Cancel
Save