From ede1d6158a8d0af5d6c73f7f9b1cfced0f264673 Mon Sep 17 00:00:00 2001 From: Abhijit Menon-Sen Date: Thu, 19 Apr 2018 22:22:41 +0530 Subject: [PATCH] Fix typo(-ish) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The «if err» test always passed after #cf938e99926 changed the earlier assignment to always set err to "\n" if stderr was empty, and so every script plugin (e.g., ec2.py) started to always report an empty ERROR. --- lib/ansible/plugins/inventory/script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/inventory/script.py b/lib/ansible/plugins/inventory/script.py index b62da1ff82a..35008fa2e83 100644 --- a/lib/ansible/plugins/inventory/script.py +++ b/lib/ansible/plugins/inventory/script.py @@ -121,7 +121,7 @@ class InventoryModule(BaseInventoryPlugin, Cacheable): raise AnsibleError("failed to parse executable inventory script results from {0}: {1}\n{2}".format(path, to_native(e), err)) # if no other errors happened and you want to force displaying stderr, do so now - if err and self.get_option('always_show_stderr'): + if stderr and self.get_option('always_show_stderr'): self.display.error(msg=to_text(err)) processed = self._cache[cache_key]