Skip to content

Commit e035ce9

Browse files
committed
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)
1 parent 2030f82 commit e035ce9

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

bin/ansible-playbook

+1-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ from ansible.color import ANSIBLE_COLOR, stringc
3131

3232
def colorize(lead, num, color):
3333
""" Print 'lead' = 'num' in 'color' """
34-
if num == 0:
35-
color='black';
36-
if ANSIBLE_COLOR:
34+
if num != 0 and ANSIBLE_COLOR:
3735
return "%s%s%-15s" % (stringc(lead, color), stringc("=", color), stringc(str(num), color))
3836
else:
3937
return "%s=%-4s" % (lead, str(num))

lib/ansible/callbacks.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,12 @@ def on_async_poll(self, host, res, jid, clock):
328328
if self._async_notified[jid] > clock:
329329
self._async_notified[jid] = clock
330330
msg = "<job %s> polling, %ss remaining"%(jid, clock)
331-
print stringc(msg, 'blue')
331+
print stringc(msg, 'cyan')
332332

333333
def on_async_ok(self, host, res, jid):
334334

335335
msg = "<job %s> finished on %s"%(jid, host)
336-
print stringc(msg, 'blue')
336+
print stringc(msg, 'cyan')
337337

338338
def on_async_failed(self, host, res, jid):
339339

@@ -379,12 +379,12 @@ def on_setup(self):
379379
def on_import_for_host(self, host, imported_file):
380380

381381
msg = "%s: importing %s" % (host, imported_file)
382-
print stringc(msg, 'blue')
382+
print stringc(msg, 'cyan')
383383

384384
def on_not_import_for_host(self, host, missing_file):
385385

386386
msg = "%s: not importing file: %s" % (host, missing_file)
387-
print stringc(msg, 'blue')
387+
print stringc(msg, 'cyan')
388388

389389
def on_play_start(self, pattern):
390390

lib/ansible/color.py

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
'blue': '0;34', 'white': '1;37',
4141
'green': '0;32', 'bright blue': '1;34',
4242
'cyan': '0;36', 'bright green': '1;32',
43+
# 'cyan': '0;32', 'bright green': '1;32',
4344
'red': '0;31', 'bright cyan': '1;36',
4445
'purple': '0;35', 'bright red': '1;31',
4546
'yellow': '0;33', 'bright purple': '1;35',

0 commit comments

Comments
 (0)