From 71ffb86c30f2c485ab1d3f6c864ab77d79c957ca Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 16 Oct 2015 15:20:10 -0400 Subject: [PATCH] don't let cowsay issues stop execution fixes #12773 --- lib/ansible/utils/display.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/ansible/utils/display.py b/lib/ansible/utils/display.py index c91f4f83db..e4bc923a1a 100644 --- a/lib/ansible/utils/display.py +++ b/lib/ansible/utils/display.py @@ -81,9 +81,13 @@ class Display: self.set_cowsay_info() if self.cowsay: - cmd = subprocess.Popen([self.cowsay, "-l"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - (out, err) = cmd.communicate() - self.cows_available = list(set(C.ANSIBLE_COW_WHITELIST).intersection(out.split())) + try: + cmd = subprocess.Popen([self.cowsay, "-l"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + (out, err) = cmd.communicate() + self.cows_available = list(set(C.ANSIBLE_COW_WHITELIST).intersection(out.split())) + except: + # could not execute cowsay for some reason + self.cowsay = False self._set_column_width()