mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Merge pull request #965 from dhozac/cowsay-no-shell
Invoke cowsay without going through the shell
This commit is contained in:
@@ -121,8 +121,8 @@ def regular_generic_msg(hostname, result, oneline, caption):
|
|||||||
def banner(msg):
|
def banner(msg):
|
||||||
|
|
||||||
if cowsay != None:
|
if cowsay != None:
|
||||||
cmd = subprocess.Popen("%s -W 60 \"%s\"" % (cowsay, msg),
|
cmd = subprocess.Popen([cowsay, "-W", "60", msg],
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
(out, err) = cmd.communicate()
|
(out, err) = cmd.communicate()
|
||||||
return "%s\n" % out
|
return "%s\n" % out
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user