blue on black, tears on a river, push on a shove, it don't mean much

(make colorized playbook runs not suck on black terminals)
This commit is contained in:
Michael DeHaan 2012-07-25 20:29:20 -04:00
commit e035ce97ce
3 changed files with 6 additions and 7 deletions

View file

@ -31,9 +31,7 @@ from ansible.color import ANSIBLE_COLOR, stringc
def colorize(lead, num, color):
""" Print 'lead' = 'num' in 'color' """
if num == 0:
color='black';
if ANSIBLE_COLOR:
if num != 0 and ANSIBLE_COLOR:
return "%s%s%-15s" % (stringc(lead, color), stringc("=", color), stringc(str(num), color))
else:
return "%s=%-4s" % (lead, str(num))