(cherry picked from commit 01e7f44e0d)
This commit is contained in:
Brian Coca 2018-04-27 14:06:56 -04:00 committed by Matt Davis
parent 05f04c173c
commit 86663c8060
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- dont emit empty error due to \n https://github.com/ansible/ansible/pull/39019

View file

@ -104,7 +104,10 @@ class InventoryModule(BaseInventoryPlugin, Cacheable):
(stdout, stderr) = sp.communicate()
path = to_native(path)
err = to_native(stderr or "") + "\n"
err = to_native(stderr or "")
if err and not err.endswith('\n'):
err += '\n'
if sp.returncode != 0:
raise AnsibleError("Inventory script (%s) had an execution error: %s " % (path, err))