diff --git a/lib/ansible/modules/extras/packaging/elasticsearch_plugin.py b/lib/ansible/modules/extras/packaging/elasticsearch_plugin.py index 25b49e2c93d..e352f71758d 100644 --- a/lib/ansible/modules/extras/packaging/elasticsearch_plugin.py +++ b/lib/ansible/modules/extras/packaging/elasticsearch_plugin.py @@ -118,7 +118,10 @@ def is_plugin_present(plugin_dir, working_dir): def parse_error(string): reason = "reason: " - return string[string.index(reason) + len(reason):].strip() + try: + return string[string.index(reason) + len(reason):].strip() + except ValueError: + return string def main():