perf: ansible log (#9499)

Co-authored-by: feng <1304903146@qq.com>
pull/9494/head^2
fit2bot 2023-02-10 14:37:55 +08:00 committed by GitHub
parent 0c11a602a8
commit e36506c3b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -174,7 +174,7 @@ class BasePlaybookManager:
pass
def on_host_error(self, host, error, result):
pass
print('host error: {} -> {}'.format(host, error))
def on_runner_success(self, runner, cb):
summary = cb.summary
@ -200,8 +200,11 @@ class BasePlaybookManager:
runners = self.get_runners()
if len(runners) > 1:
print("### 分批次执行开始任务, 总共 {}\n".format(len(runners)))
else:
elif len(runners) == 1:
print(">>> 开始执行任务\n")
else:
print("### 没有需要执行的任务\n")
return
self.execution.date_start = timezone.now()
for i, runner in enumerate(runners, start=1):