mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
elasticsearch_plugin - Show STDERR on module failures. (#41954)
* elasticsearch_plugin - Show STDERR on module failures. I tried to install a ES plugin without become: yes and found after debugging the module that the module failed ude to permission issues. The only error message I got was Is analysis-icu a valid plugin name? That was strange considering I followed the example documentation by the letter. I found out that when this module fails, it hides the real reason for failure. This patch replaces the generic error with more meaningful diagnostics. * elasticsearch_plugin - Show STDERR on module failures. Changelog fragment samdoran commented 2 days ago This looks good. Please create a changelog fragment to go along with this change. See fragments for examples.
This commit is contained in:
parent
fabd7823b2
commit
8eacbd0381
2 changed files with 5 additions and 2 deletions
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
bugfixes:
|
||||||
|
- elasticsearch_plugin - Improve error messages and show stderr of elasticsearch commands
|
|
@ -175,7 +175,7 @@ def install_plugin(module, plugin_bin, plugin_name, version, url, proxy_host, pr
|
||||||
|
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
reason = parse_error(out)
|
reason = parse_error(out)
|
||||||
module.fail_json(msg='Is %s a valid plugin name?' % plugin_name, err=reason)
|
module.fail_json(msg="Installing plugin '%s' failed: %s" % (plugin_name, reason), err=err)
|
||||||
|
|
||||||
return True, cmd, out, err
|
return True, cmd, out, err
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ def remove_plugin(module, plugin_bin, plugin_name):
|
||||||
|
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
reason = parse_error(out)
|
reason = parse_error(out)
|
||||||
module.fail_json(msg=reason)
|
module.fail_json(msg="Removing plugin '%s' failed: %s" % (plugin_name, reason), err=err)
|
||||||
|
|
||||||
return True, cmd, out, err
|
return True, cmd, out, err
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue