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:
parent
9cba458e3e
commit
2f83a5b084
2 changed files with 5 additions and 2 deletions
|
|
@ -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))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue