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]