Skip to content

Commit

Permalink
[PR #7374/479e7df6 backport][stable-7] Fix callback/selective task pr…
Browse files Browse the repository at this point in the history
…int being long (#7391)

Fix callback/selective task print being long (#7374)

* Fix callback/selective task print being long

Compare against all text on the line rather than simply the task_name var,
which does not include 3 formatting characters in the string

* Add changelog fragment

---------

Co-authored-by: Aidan Houck <AidanHouck@users.noreply.github.com>
(cherry picked from commit 479e7df)

Co-authored-by: Aidan Houck <92699100+AidanHouck@users.noreply.github.com>
  • Loading branch information
patchback[bot] and AidanHouck authored Oct 11, 2023
1 parent 7ce39c3 commit 5100d97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "selective callback plugin - fix length of task name lines in output always being 3 characters longer than desired (https://github.com/ansible-collections/community.general/pull/7374)."
4 changes: 2 additions & 2 deletions plugins/callback/selective.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ def _print_task(self, task_name=None):
line_length = 120
if self.last_skipped:
print()
msg = colorize("# {0} {1}".format(task_name,
'*' * (line_length - len(task_name))), 'bold')
line = "# {0} ".format(task_name)
msg = colorize("{0}{1}".format(line, '*' * (line_length - len(line))), 'bold')
print(msg)

def _indent_text(self, text, indent_level):
Expand Down

0 comments on commit 5100d97

Please sign in to comment.