mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-26 00:16:49 +00:00
Allowing hostcolor colours to be set
This commit is contained in:
committed by
Brian Coca
parent
d9d7e413a5
commit
3a6743fb54
@@ -86,10 +86,10 @@ def colorize(lead, num, color):
|
||||
def hostcolor(host, stats, color=True):
|
||||
if ANSIBLE_COLOR and color:
|
||||
if stats['failures'] != 0 or stats['unreachable'] != 0:
|
||||
return u"%-37s" % stringc(host, 'red')
|
||||
return u"%-37s" % stringc(host, C.COLOR_ERROR)
|
||||
elif stats['changed'] != 0:
|
||||
return u"%-37s" % stringc(host, 'yellow')
|
||||
return u"%-37s" % stringc(host, C.COLOR_CHANGED)
|
||||
else:
|
||||
return u"%-37s" % stringc(host, 'green')
|
||||
return u"%-37s" % stringc(host, C.COLOR_OK)
|
||||
return u"%-26s" % host
|
||||
|
||||
|
||||
Reference in New Issue
Block a user