Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
code review comment updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
chambridge committed Aug 28, 2017
1 parent 34a2c9d commit aa89a5d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rho/utilities.py
Expand Up @@ -141,10 +141,11 @@ def tail_and_follow(path, ansible_verbosity):
"""
if len(path) > 0: # pylint: disable=len-as-condition
truncate = 1
if ansible_verbosity > 0:
if ansible_verbosity:
truncate = ansible_verbosity

print_line = truncate
plabook_started = False
truncated = False

# pylint: disable=no-member
Expand All @@ -153,16 +154,17 @@ def tail_and_follow(path, ansible_verbosity):
if line.startswith('TASK') or line.startswith('PLAY'):
print(line)
print_line = truncate
plabook_started = True
truncated = False
elif print_line > 0:
line_len = len(line)
char_truncate = truncate * 100
if line_len > char_truncate:
print(line[0:char_truncate])
print(line[0:char_truncate] + '...')
else:
print(line)
print_line = print_line - 1
elif print_line == 0 and not truncated:
elif print_line == 0 and not truncated and plabook_started:
print(_('-- output truncated --'))
truncated = True

Expand Down

0 comments on commit aa89a5d

Please sign in to comment.