Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
e035ce97
Commit
e035ce97
authored
Jul 25, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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)
parent
2030f82b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
7 deletions
+6
-7
bin/ansible-playbook
+1
-3
lib/ansible/callbacks.py
+4
-4
lib/ansible/color.py
+1
-0
No files found.
bin/ansible-playbook
View file @
e035ce97
...
...
@@ -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
%-15
s"
%
(
stringc
(
lead
,
color
),
stringc
(
"="
,
color
),
stringc
(
str
(
num
),
color
))
else
:
return
"
%
s=
%-4
s"
%
(
lead
,
str
(
num
))
...
...
lib/ansible/callbacks.py
View file @
e035ce97
...
...
@@ -328,12 +328,12 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks):
if
self
.
_async_notified
[
jid
]
>
clock
:
self
.
_async_notified
[
jid
]
=
clock
msg
=
"<job
%
s> polling,
%
ss remaining"
%
(
jid
,
clock
)
print
stringc
(
msg
,
'
blue
'
)
print
stringc
(
msg
,
'
cyan
'
)
def
on_async_ok
(
self
,
host
,
res
,
jid
):
msg
=
"<job
%
s> finished on
%
s"
%
(
jid
,
host
)
print
stringc
(
msg
,
'
blue
'
)
print
stringc
(
msg
,
'
cyan
'
)
def
on_async_failed
(
self
,
host
,
res
,
jid
):
...
...
@@ -379,12 +379,12 @@ class PlaybookCallbacks(object):
def
on_import_for_host
(
self
,
host
,
imported_file
):
msg
=
"
%
s: importing
%
s"
%
(
host
,
imported_file
)
print
stringc
(
msg
,
'
blue
'
)
print
stringc
(
msg
,
'
cyan
'
)
def
on_not_import_for_host
(
self
,
host
,
missing_file
):
msg
=
"
%
s: not importing file:
%
s"
%
(
host
,
missing_file
)
print
stringc
(
msg
,
'
blue
'
)
print
stringc
(
msg
,
'
cyan
'
)
def
on_play_start
(
self
,
pattern
):
...
...
lib/ansible/color.py
View file @
e035ce97
...
...
@@ -40,6 +40,7 @@ codeCodes = {
'blue'
:
'0;34'
,
'white'
:
'1;37'
,
'green'
:
'0;32'
,
'bright blue'
:
'1;34'
,
'cyan'
:
'0;36'
,
'bright green'
:
'1;32'
,
# 'cyan': '0;32', 'bright green': '1;32',
'red'
:
'0;31'
,
'bright cyan'
:
'1;36'
,
'purple'
:
'0;35'
,
'bright red'
:
'1;31'
,
'yellow'
:
'0;33'
,
'bright purple'
:
'1;35'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment