update color name consistency

This commit is contained in:
Justin Findlay 2014-12-25 00:06:29 -07:00
parent 32f5f245ca
commit 751e0c7f43
6 changed files with 33 additions and 33 deletions

View file

@ -96,7 +96,7 @@ def _format_host(host, data):
hcolor = colors['CYAN'] # Print the minion name in cyan
if isinstance(data, list):
# Errors have been detected, list them in RED!
hcolor = colors['RED_BOLD']
hcolor = colors['LIGHT_RED']
hstrs.append((u' {0}Data failed to compile:{1[ENDC]}'
.format(hcolor, colors)))
for err in data:
@ -141,8 +141,8 @@ def _format_host(host, data):
hcolor = colors['RED']
tcolor = colors['RED']
if ret['result'] is None:
hcolor = colors['YELLOW']
tcolor = colors['YELLOW']
hcolor = colors['LIGHT_YELLOW']
tcolor = colors['LIGHT_YELLOW']
comps = tname.split('_|-')
if __opts__.get('state_output', 'full').lower() == 'filter':
# By default, full data is shown for all types. However, return
@ -276,7 +276,7 @@ def _format_host(host, data):
# test=True states
changestats.append(
colorfmt.format(
colors['YELLOW'],
colors['LIGHT_YELLOW'],
u'unchanged={0}'.format(rcounts.get(None, 0)),
colors
)

View file

@ -27,9 +27,9 @@ def output(data):
cmap = {pend: color['RED'],
acc: color['GREEN'],
den: color['PURPLE'],
den: color['MAGENTA'],
rej: color['BLUE'],
'local': color['PURPLE']}
'local': color['MAGENTA']}
trans = {pend: u'{0}Unaccepted Keys:{1}'.format(
color['LIGHT_RED'],
@ -38,13 +38,13 @@ def output(data):
color['LIGHT_GREEN'],
color['ENDC']),
den: u'{0}Denied Keys:{1}'.format(
color['LIGHT_PURPLE'],
color['LIGHT_MAGENTA'],
color['ENDC']),
rej: u'{0}Rejected Keys:{1}'.format(
color['LIGHT_BLUE'],
color['ENDC']),
'local': u'{0}Local Keys:{1}'.format(
color['LIGHT_PURPLE'],
color['LIGHT_MAGENTA'],
color['ENDC'])}
else:
acc = 'accepted'
@ -54,7 +54,7 @@ def output(data):
cmap = {pend: color['RED'],
acc: color['GREEN'],
rej: color['BLUE'],
'local': color['PURPLE']}
'local': color['MAGENTA']}
trans = {pend: u'{0}Unaccepted Keys:{1}'.format(
color['LIGHT_RED'],
@ -66,7 +66,7 @@ def output(data):
color['LIGHT_BLUE'],
color['ENDC']),
'local': u'{0}Local Keys:{1}'.format(
color['LIGHT_PURPLE'],
color['LIGHT_MAGENTA'],
color['ENDC'])}
ret = ''

View file

@ -66,7 +66,7 @@ class NestDisplay(object):
if ret is None or ret is True or ret is False:
out += self.ustring(
' ' * indent,
self.colors['YELLOW'],
self.colors['LIGHT_YELLOW'],
ret,
prefix=prefix)
# Number includes all python numbers types
@ -74,7 +74,7 @@ class NestDisplay(object):
elif isinstance(ret, Number):
out += self.ustring(
' ' * indent,
self.colors['YELLOW'],
self.colors['LIGHT_YELLOW'],
ret,
prefix=prefix)
elif isinstance(ret, string_types):

View file

@ -143,23 +143,23 @@ def get_colors(use=True):
no_colors = get_colors(False) # disable all colors
red_colors = get_colors('RED') # set all colors to red
'''
colors = {
'BLACK': TextFormat('black'),
'DARK_GRAY': TextFormat('bold', 'black'),
'LIGHT_GRAY': TextFormat('white'),
'BLUE': TextFormat('blue'),
'LIGHT_BLUE': TextFormat('bold', 'blue'),
'GREEN': TextFormat('green'),
'LIGHT_GREEN': TextFormat('bold', 'green'),
'CYAN': TextFormat('cyan'),
'LIGHT_CYAN': TextFormat('bold', 'cyan'),
'RED': TextFormat('red'),
'LIGHT_RED': TextFormat('bold', 'red'),
'RED_BOLD': TextFormat('bold', 'red'),
'PURPLE': TextFormat('magenta'),
'LIGHT_PURPLE': TextFormat('bold', 'magenta'),
'BROWN': TextFormat('yellow'),
'YELLOW': TextFormat('bold', 'yellow'),
'GREEN': TextFormat('green'),
'LIGHT_GREEN': TextFormat('bold', 'green'),
'YELLOW': TextFormat('yellow'),
'LIGHT_YELLOW': TextFormat('bold', 'yellow'),
'BLUE': TextFormat('blue'),
'LIGHT_BLUE': TextFormat('bold', 'blue'),
'MAGENTA': TextFormat('magenta'),
'LIGHT_MAGENTA': TextFormat('bold', 'magenta'),
'CYAN': TextFormat('cyan'),
'LIGHT_CYAN': TextFormat('bold', 'cyan'),
'LIGHT_GRAY': TextFormat('white'),
'WHITE': TextFormat('bold', 'white'),
'DEFAULT_COLOR': TextFormat('default'),
'ENDC': TextFormat('reset'),

View file

@ -666,7 +666,7 @@ class TestDaemon(object):
wait_minion_connections.terminate()
if wait_minion_connections.exitcode > 0:
print(
'\n {RED_BOLD}*{ENDC} ERROR: Minions failed to connect'.format(
'\n {LIGHT_RED}*{ENDC} ERROR: Minions failed to connect'.format(
**self.colors
)
)
@ -788,7 +788,7 @@ class TestDaemon(object):
if job_finished is False:
sys.stdout.write(
' * {YELLOW}[Quit in {0}]{ENDC} Waiting for {1}'.format(
' * {LIGHT_YELLOW}[Quit in {0}]{ENDC} Waiting for {1}'.format(
'{0}'.format(expire - now).rsplit('.', 1)[0],
', '.join(running),
**self.colors
@ -799,7 +799,7 @@ class TestDaemon(object):
now = datetime.now()
else: # pylint: disable=W0120
sys.stdout.write(
'\n {RED_BOLD}*{ENDC} ERROR: Failed to get information '
'\n {LIGHT_RED}*{ENDC} ERROR: Failed to get information '
'back\n'.format(**self.colors)
)
sys.stdout.flush()
@ -835,7 +835,7 @@ class TestDaemon(object):
)
)
sys.stdout.write(
' * {YELLOW}[Quit in {0}]{ENDC} Waiting for {1}'.format(
' * {LIGHT_YELLOW}[Quit in {0}]{ENDC} Waiting for {1}'.format(
'{0}'.format(expire - now).rsplit('.', 1)[0],
', '.join(expected_connections),
**self.colors
@ -871,7 +871,7 @@ class TestDaemon(object):
now = datetime.now()
else: # pylint: disable=W0120
print(
'\n {RED_BOLD}*{ENDC} WARNING: Minions failed to connect '
'\n {LIGHT_RED}*{ENDC} WARNING: Minions failed to connect '
'back. Tests requiring them WILL fail'.format(**self.colors)
)
try:
@ -905,7 +905,7 @@ class TestDaemon(object):
if self.wait_for_jid(targets, jid_info['jid'], timeout) is False:
print(
' {RED_BOLD}*{ENDC} WARNING: Minions failed to sync {0}. '
' {LIGHT_RED}*{ENDC} WARNING: Minions failed to sync {0}. '
'Tests requiring these {0} WILL fail'.format(
modules_kind, **self.colors)
)
@ -923,7 +923,7 @@ class TestDaemon(object):
if isinstance(output['ret'], string_types):
# An errors has occurred
print(
' {RED_BOLD}*{ENDC} {0} Failed to sync {2}: '
' {LIGHT_RED}*{ENDC} {0} Failed to sync {2}: '
'{1}'.format(
name, output['ret'],
modules_kind,
@ -944,7 +944,7 @@ class TestDaemon(object):
syncing.remove(name)
except KeyError:
print(
' {RED_BOLD}*{ENDC} {0} already synced??? '
' {LIGHT_RED}*{ENDC} {0} already synced??? '
'{1}'.format(name, output, **self.colors)
)
return True

View file

@ -653,7 +653,7 @@ class UtilsTestCase(TestCase):
self.assertDictContainsSubset({'LIGHT_GRAY': ''}, ret)
ret = utils.get_colors(use='LIGHT_GRAY')
self.assertDictContainsSubset({'YELLOW': '\x1b[0;37m'}, ret) # YELLOW now == LIGHT_GRAY
self.assertDictContainsSubset({'LIGHT_YELLOW': '\x1b[0;37m'}, ret) # LIGHT_YELLOW now == LIGHT_GRAY
@skipIf(NO_MOCK, NO_MOCK_REASON)
def test_daemonize_if(self):