1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-07-07 19:18:54 +00:00

selective callback plugin: align host names in stats output (#12065)

* fix(selective): align host names in stats output

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* changelog(selective): add fragment for PR #12065

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Alexei Znamensky 2026-05-17 20:38:33 +12:00 committed by GitHub
parent 9cba458e3e
commit 2f83a5b084
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

@ -228,6 +228,7 @@ class CallbackModule(CallbackBase):
self._print_task("STATS")
hosts = sorted(stats.processed.keys())
max_len = max((len(h) for h in hosts), default=0)
for host in hosts:
s = stats.summarize(host)
@ -239,8 +240,8 @@ class CallbackModule(CallbackBase):
color = "ok"
msg = (
f"{host} : ok={s['ok']}\tchanged={s['changed']}\tfailed={s['failures']}\tunreachable="
f"{s['unreachable']}\trescued={s['rescued']}\tignored={s['ignored']}"
f"{host.ljust(max_len)} : ok={s['ok']}\tchanged={s['changed']}\tfailed={s['failures']}\t"
f"unreachable={s['unreachable']}\trescued={s['rescued']}\tignored={s['ignored']}"
)
self._display.display(colorize(msg, color))