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
c92bfb72
Commit
c92bfb72
authored
Mar 01, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'madcow2' of
git://github.com/bcoca/ansible
into devel
parents
ff32e404
e9907e9c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
lib/ansible/callbacks.py
+14
-3
No files found.
lib/ansible/callbacks.py
View file @
c92bfb72
...
...
@@ -20,7 +20,7 @@ import sys
import
getpass
import
os
import
subprocess
import
os.path
import
random
from
ansible.color
import
stringc
cowsay
=
None
...
...
@@ -37,6 +37,13 @@ elif os.path.exists("/opt/local/bin/cowsay"):
# MacPorts path for cowsay
cowsay
=
"/opt/local/bin/cowsay"
noncow
=
os
.
getenv
(
"ANSIBLE_COW_SELECTION"
,
None
)
if
cowsay
and
noncow
==
'random'
:
cmd
=
subprocess
.
Popen
([
cowsay
,
"-l"
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
(
out
,
err
)
=
cmd
.
communicate
()
cows
=
out
.
split
()
cows
.
append
(
False
)
noncow
=
random
.
choice
(
cows
)
# ****************************************************************************
# 1.1 DEV NOTES
...
...
@@ -135,8 +142,12 @@ def regular_generic_msg(hostname, result, oneline, caption):
def
banner
(
msg
):
if
cowsay
:
cmd
=
subprocess
.
Popen
([
cowsay
,
"-W"
,
"60"
,
msg
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
runcmd
=
[
cowsay
,
"-W"
,
"60"
]
if
noncow
:
runcmd
.
append
(
'-f'
)
runcmd
.
append
(
noncow
)
runcmd
.
append
(
msg
)
cmd
=
subprocess
.
Popen
(
runcmd
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
(
out
,
err
)
=
cmd
.
communicate
()
return
"
%
s
\n
"
%
out
else
:
...
...
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