From 2d448f2a3403f57601847e7b5249c2a3d0796fd1 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Thu, 30 Aug 2012 00:11:40 +0200 Subject: [PATCH] Invoke cowsay without going through the shell --- lib/ansible/callbacks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/callbacks.py b/lib/ansible/callbacks.py index 2011071d97a..27a5b1e4f30 100644 --- a/lib/ansible/callbacks.py +++ b/lib/ansible/callbacks.py @@ -121,8 +121,8 @@ def regular_generic_msg(hostname, result, oneline, caption): def banner(msg): if cowsay != None: - cmd = subprocess.Popen("%s -W 60 \"%s\"" % (cowsay, msg), - stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) + cmd = subprocess.Popen([cowsay, "-W", "60", msg], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) (out, err) = cmd.communicate() return "%s\n" % out else: