diff options
author | Matt Martz <matt@sivel.net> | 2019-08-02 18:13:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-02 18:13:08 +0200 |
commit | 38eee51057254a5fcce821e43ddc533e7f396e4d (patch) | |
tree | 0550eab224a937e7f642ab35b8a9ba738639993a | |
parent | Google: gcpubsub_facts -> gcpubsub_info (#57668) (diff) | |
download | ansible-38eee51057254a5fcce821e43ddc533e7f396e4d.tar.xz ansible-38eee51057254a5fcce821e43ddc533e7f396e4d.zip |
Fix issue with empty cow_whitelist (#59946)
* Fix issue with empty cow_whitelist. Fixes #45631
* Account for None
-rw-r--r-- | changelogs/fragments/45631-empty-cow-whitelist.yml | 2 | ||||
-rw-r--r-- | lib/ansible/utils/display.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/changelogs/fragments/45631-empty-cow-whitelist.yml b/changelogs/fragments/45631-empty-cow-whitelist.yml new file mode 100644 index 0000000000..dd556c6325 --- /dev/null +++ b/changelogs/fragments/45631-empty-cow-whitelist.yml @@ -0,0 +1,2 @@ +bugfixes: +- cowsay - Fix issue with an empty cow_whitelist (https://github.com/ansible/ansible/issues/45631) diff --git a/lib/ansible/utils/display.py b/lib/ansible/utils/display.py index 6735cf66f4..b0253c8317 100644 --- a/lib/ansible/utils/display.py +++ b/lib/ansible/utils/display.py @@ -110,7 +110,7 @@ class Display(with_metaclass(Singleton, object)): cmd = subprocess.Popen([self.b_cowsay, "-l"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) (out, err) = cmd.communicate() self.cows_available = set([to_text(c) for c in out.split()]) - if C.ANSIBLE_COW_WHITELIST: + if C.ANSIBLE_COW_WHITELIST and any(C.ANSIBLE_COW_WHITELIST): self.cows_available = set(C.ANSIBLE_COW_WHITELIST).intersection(self.cows_available) except Exception: # could not execute cowsay for some reason |