allow empty whitelist

This commit is contained in:
Brian Coca 2017-01-25 13:46:45 -05:00 committed by Brian Coca
parent 8030f6fd45
commit 9ac9d42030

View file

@ -84,7 +84,9 @@ class Display:
try:
cmd = subprocess.Popen([self.b_cowsay, "-l"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(out, err) = cmd.communicate()
self.cows_available = [ to_bytes(c) for c in set(C.ANSIBLE_COW_WHITELIST).intersection(out.split())]
self.cows_available = set([ to_bytes(c) for c in out.split() ])
if C.ANSIBLE_COW_WHITELIST:
self.cows_available = set(C.ANSIBLE_COW_WHITELIST).intersection(self.cows_available)
except:
# could not execute cowsay for some reason
self.b_cowsay = False