mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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>
This commit is contained in:
parent
4ea40e9473
commit
479e7df687
2 changed files with 4 additions and 2 deletions
|
@ -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)."
|
|
@ -106,8 +106,8 @@ class CallbackModule(CallbackBase):
|
||||||
line_length = 120
|
line_length = 120
|
||||||
if self.last_skipped:
|
if self.last_skipped:
|
||||||
print()
|
print()
|
||||||
msg = colorize("# {0} {1}".format(task_name,
|
line = "# {0} ".format(task_name)
|
||||||
'*' * (line_length - len(task_name))), 'bold')
|
msg = colorize("{0}{1}".format(line, '*' * (line_length - len(line))), 'bold')
|
||||||
print(msg)
|
print(msg)
|
||||||
|
|
||||||
def _indent_text(self, text, indent_level):
|
def _indent_text(self, text, indent_level):
|
||||||
|
|
Loading…
Reference in a new issue