1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Enabled cowsay support for Ubuntu

This commit is contained in:
Ingo Gottwald 2012-07-12 11:14:15 +02:00
parent 87e911c405
commit 26aa4e2469

View file

@ -78,8 +78,16 @@ class AggregateStats(object):
def banner(msg):
res = ""
global COWSAY
if os.path.exists("/usr/bin/cowsay"):
cmd = subprocess.Popen("/usr/bin/cowsay -W 60 \"%s\"" % msg,
COWSAY = "/usr/bin/cowsay"
elif os.path.exists("/usr/games/cowsay"):
COWSAY = "/usr/games/cowsay"
else:
COWSAY = None
if COWSAY != None:
cmd = subprocess.Popen("%s -W 60 \"%s\"" % (COWSAY, msg),
stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
(out, err) = cmd.communicate()
res = "%s\n" % out