Skip to content

Commit 846fd30

Browse files
authored
Merge pull request #33 from octplane/task/32
Fix for #32
2 parents c700998 + 0a467e4 commit 846fd30

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

callbacks/anstomlog.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55

66
import sys
77
import os
8-
import json
98
from datetime import datetime
109

11-
from ansible.utils.color import colorize, hostcolor
10+
from ansible.utils.color import colorize, hostcolor, ANSIBLE_COLOR
1211
from ansible.plugins.callback import CallbackBase
1312
from ansible import constants as C
1413
from ansible.vars.clean import strip_internal_keys, module_response_deepcopy
@@ -391,6 +390,10 @@ def v2_runner_on_ok(self, result):
391390

392391
result._preamble = self.task_start_preamble
393392

393+
def eat(self, count=4):
394+
if ANSIBLE_COLOR:
395+
sys.stdout.write(count*"\b")
396+
394397
@staticmethod
395398
def _changed_or_not(result, host_string):
396399
if result.get('changed', False):
@@ -408,7 +411,8 @@ def _emit_line(self, lines, color=C.COLOR_OK):
408411
self._open_section("system")
409412

410413
if self.task_start_preamble.endswith(" ..."):
411-
sys.stdout.write("\b\b\b\b | ")
414+
self.eat()
415+
self.stdout.write(" | ")
412416
self.task_start_preamble = " "
413417

414418
for line in lines.splitlines():

0 commit comments

Comments
 (0)