tests for InventoryModule error conditions (#31381)

* tests for InventoryModule error conditions

* modified unicode in tests to ahear to Ansible best practices

* flake8 fixes
This commit is contained in:
Chris Meyers 2017-10-16 18:52:44 -04:00 committed by ansibot
parent 68f177d381
commit cf938e9992
2 changed files with 105 additions and 2 deletions

View file

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