We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Verbs change in Elasticsearch 2.0.0
Since Elasticsearch 2.0.0 `plugin` dropped the double-dash for verbs. So what used to be `--install` now became `install`. Hence, [this](https://github.com/ansible/ansible-modules-extras/blob/devel/packaging/elasticsearch_plugin.py#L114-L117) doesn't work with new versions.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `packaging/elasticsearch_plugin.py`
Content:
```
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3 
4 import os
5 
6 """
7 Ansible module to manage elasticsearch plugins
8 (c) 2015, Mathew Davies <thepixeldeveloper@googlemail.com>
9 
10 This file is part of Ansible
11 
12 Ansible is free software: you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation, either version 3 of the License, or
15 (at your option) any later version.
16 
17 Ansible is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
23 """
24 
25 DOCUMENTATION = '''
26 ---
27 module: elasticsearch_plugin
28 short_description: Manage Elasticsearch plugins
29 description:
30     - Manages Elasticsearch plugins.
31 version_added: "2.0"
32 author: Mathew Davies (@ThePixelDeveloper)
33 options:
34     name:
35         description:
36             - Name of the plugin to install
37         required: True
38     state:
39         description:
40             - Desired state of a plugin.
41         required: False
42         choices: [present, absent]
43         default: present
44     url:
45         description:
46             - Set exact URL to download the plugin from
47         required: False
48         default: None
49     timeout:
50         description:
51             - "Timeout setting: 30s, 1m, 1h..."
52         required: False
53         default: 1m
54     plugin_bin:
55         description:
56             - Location of the plugin binary
57         required: False
58         default: /usr/share/elasticsearch/bin/plugin
59     plugin_dir:
60         description:
61             - Your configured plugin directory specified in Elasticsearch
62         required: False
63         default: /usr/share/elasticsearch/plugins/
64     version:
65         description:
66             - Version of the plugin to be installed.
67               If plugin exists with previous version, it will NOT be updated
68         required: False
69         default: None
70 '''
71 
72 EXAMPLES = '''
73 # Install Elasticsearch head plugin
74 - elasticsearch_plugin: state=present name="mobz/elasticsearch-head"
75 
76 # Install specific version of a plugin
77 - elasticsearch_plugin: state=present name="com.github.kzwang/elasticsearch-image" version="1.2.0"
78 
79 # Uninstall Elasticsearch head plugin
80 - elasticsearch_plugin: state=absent name="mobz/elasticsearch-head"
81 '''
82 
83 
84 def parse_plugin_repo(string):
85     elements = string.split("/")
86 
87     # We first consider the simplest form: pluginname
88     repo = elements[0]
89 
90     # We consider the form: username/pluginname
91     if len(elements) > 1:
92         repo = elements[1]
93 
94     # remove elasticsearch- prefix
95     # remove es- prefix
96     for string in ("elasticsearch-", "es-"):
97         if repo.startswith(string):
98             return repo[len(string):]
99 
100     return repo
101 
102 
103 def is_plugin_present(plugin_dir, working_dir):
104     return os.path.isdir(os.path.join(working_dir, plugin_dir))
105 
106 
107 def parse_error(string):
108     reason = "reason: "
109     return string[string.index(reason) + len(reason):].strip()
110 
111 
112 def main():
113 
114     package_state_map = dict(
115         present="--install",
116         absent="--remove"
117     )
118 
119     module = AnsibleModule(
120         argument_spec=dict(
121             name=dict(required=True),
122             state=dict(default="present", choices=package_state_map.keys()),
123             url=dict(default=None),
124             timeout=dict(default="1m"),
125             plugin_bin=dict(default="/usr/share/elasticsearch/bin/plugin"),
126             plugin_dir=dict(default="/usr/share/elasticsearch/plugins/"),
127             version=dict(default=None)
128         )
129     )
130 
131     plugin_bin = module.params["plugin_bin"]
132     plugin_dir = module.params["plugin_dir"]
133     name = module.params["name"]
134     state = module.params["state"]
135     url = module.params["url"]
136     timeout = module.params["timeout"]
137     version = module.params["version"]
138 
139     present = is_plugin_present(parse_plugin_repo(name), plugin_dir)
140 
141     # skip if the state is correct
142     if (present and state == "present") or (state == "absent" and not present):
143         module.exit_json(changed=False, name=name)
144 
145     if (version):
146        name = name + '/' + version
147 
148     cmd_args = [plugin_bin, package_state_map[state], name]
149 
150     if url:
151         cmd_args.append("--url %s" % url)
152 
153     if timeout:
154         cmd_args.append("--timeout %s" % timeout)
155 
156     cmd = " ".join(cmd_args)
157 
158     rc, out, err = module.run_command(cmd)
159 
160     if rc != 0:
161         reason = parse_error(out)
162         module.fail_json(msg=reason)
163 
164     module.exit_json(changed=True, cmd=cmd, name=name, state=state, url=url, timeout=timeout, stdout=out, stderr=err)
165 
166 from ansible.module_utils.basic import *
167 
168 main()
169
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/packaging/elasticsearch_plugin.py b/packaging/elasticsearch_plugin.py
--- a/packaging/elasticsearch_plugin.py
+++ b/packaging/elasticsearch_plugin.py
@@ -33,7 +33,7 @@
 options:
     name:
         description:
-            - Name of the plugin to install
+            - Name of the plugin to install. In ES 2.x, the name can be an url or file location
         required: True
     state:
         description:
@@ -43,7 +43,7 @@
         default: present
     url:
         description:
-            - Set exact URL to download the plugin from
+            - Set exact URL to download the plugin from (Only works for ES 1.x)
         required: False
         default: None
     timeout:
@@ -112,8 +112,8 @@
 def main():
 
     package_state_map = dict(
-        present="--install",
-        absent="--remove"
+        present="install",
+        absent="remove"
     )
 
     module = AnsibleModule(

{"golden_diff": "diff --git a/packaging/elasticsearch_plugin.py b/packaging/elasticsearch_plugin.py\n--- a/packaging/elasticsearch_plugin.py\n+++ b/packaging/elasticsearch_plugin.py\n@@ -33,7 +33,7 @@\n options:\n     name:\n         description:\n-            - Name of the plugin to install\n+            - Name of the plugin to install. In ES 2.x, the name can be an url or file location\n         required: True\n     state:\n         description:\n@@ -43,7 +43,7 @@\n         default: present\n     url:\n         description:\n-            - Set exact URL to download the plugin from\n+            - Set exact URL to download the plugin from (Only works for ES 1.x)\n         required: False\n         default: None\n     timeout:\n@@ -112,8 +112,8 @@\n def main():\n \n     package_state_map = dict(\n-        present=\"--install\",\n-        absent=\"--remove\"\n+        present=\"install\",\n+        absent=\"remove\"\n     )\n \n     module = AnsibleModule(\n", "issue": "Verbs change in Elasticsearch 2.0.0\nSince Elasticsearch 2.0.0 `plugin` dropped the double-dash for verbs. So what used to be `--install` now became `install`. Hence, [this](https://github.com/ansible/ansible-modules-extras/blob/devel/packaging/elasticsearch_plugin.py#L114-L117) doesn't work with new versions.\n\n", "before_files": [{"content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport os\n\n\"\"\"\nAnsible module to manage elasticsearch plugins\n(c) 2015, Mathew Davies <thepixeldeveloper@googlemail.com>\n\nThis file is part of Ansible\n\nAnsible is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nAnsible is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\nYou should have received a copy of the GNU General Public License\nalong with Ansible.  If not, see <http://www.gnu.org/licenses/>.\n\"\"\"\n\nDOCUMENTATION = '''\n---\nmodule: elasticsearch_plugin\nshort_description: Manage Elasticsearch plugins\ndescription:\n    - Manages Elasticsearch plugins.\nversion_added: \"2.0\"\nauthor: Mathew Davies (@ThePixelDeveloper)\noptions:\n    name:\n        description:\n            - Name of the plugin to install\n        required: True\n    state:\n        description:\n            - Desired state of a plugin.\n        required: False\n        choices: [present, absent]\n        default: present\n    url:\n        description:\n            - Set exact URL to download the plugin from\n        required: False\n        default: None\n    timeout:\n        description:\n            - \"Timeout setting: 30s, 1m, 1h...\"\n        required: False\n        default: 1m\n    plugin_bin:\n        description:\n            - Location of the plugin binary\n        required: False\n        default: /usr/share/elasticsearch/bin/plugin\n    plugin_dir:\n        description:\n            - Your configured plugin directory specified in Elasticsearch\n        required: False\n        default: /usr/share/elasticsearch/plugins/\n    version:\n        description:\n            - Version of the plugin to be installed.\n              If plugin exists with previous version, it will NOT be updated\n        required: False\n        default: None\n'''\n\nEXAMPLES = '''\n# Install Elasticsearch head plugin\n- elasticsearch_plugin: state=present name=\"mobz/elasticsearch-head\"\n\n# Install specific version of a plugin\n- elasticsearch_plugin: state=present name=\"com.github.kzwang/elasticsearch-image\" version=\"1.2.0\"\n\n# Uninstall Elasticsearch head plugin\n- elasticsearch_plugin: state=absent name=\"mobz/elasticsearch-head\"\n'''\n\n\ndef parse_plugin_repo(string):\n    elements = string.split(\"/\")\n\n    # We first consider the simplest form: pluginname\n    repo = elements[0]\n\n    # We consider the form: username/pluginname\n    if len(elements) > 1:\n        repo = elements[1]\n\n    # remove elasticsearch- prefix\n    # remove es- prefix\n    for string in (\"elasticsearch-\", \"es-\"):\n        if repo.startswith(string):\n            return repo[len(string):]\n\n    return repo\n\n\ndef is_plugin_present(plugin_dir, working_dir):\n    return os.path.isdir(os.path.join(working_dir, plugin_dir))\n\n\ndef parse_error(string):\n    reason = \"reason: \"\n    return string[string.index(reason) + len(reason):].strip()\n\n\ndef main():\n\n    package_state_map = dict(\n        present=\"--install\",\n        absent=\"--remove\"\n    )\n\n    module = AnsibleModule(\n        argument_spec=dict(\n            name=dict(required=True),\n            state=dict(default=\"present\", choices=package_state_map.keys()),\n            url=dict(default=None),\n            timeout=dict(default=\"1m\"),\n            plugin_bin=dict(default=\"/usr/share/elasticsearch/bin/plugin\"),\n            plugin_dir=dict(default=\"/usr/share/elasticsearch/plugins/\"),\n            version=dict(default=None)\n        )\n    )\n\n    plugin_bin = module.params[\"plugin_bin\"]\n    plugin_dir = module.params[\"plugin_dir\"]\n    name = module.params[\"name\"]\n    state = module.params[\"state\"]\n    url = module.params[\"url\"]\n    timeout = module.params[\"timeout\"]\n    version = module.params[\"version\"]\n\n    present = is_plugin_present(parse_plugin_repo(name), plugin_dir)\n\n    # skip if the state is correct\n    if (present and state == \"present\") or (state == \"absent\" and not present):\n        module.exit_json(changed=False, name=name)\n\n    if (version):\n       name = name + '/' + version\n\n    cmd_args = [plugin_bin, package_state_map[state], name]\n\n    if url:\n        cmd_args.append(\"--url %s\" % url)\n\n    if timeout:\n        cmd_args.append(\"--timeout %s\" % timeout)\n\n    cmd = \" \".join(cmd_args)\n\n    rc, out, err = module.run_command(cmd)\n\n    if rc != 0:\n        reason = parse_error(out)\n        module.fail_json(msg=reason)\n\n    module.exit_json(changed=True, cmd=cmd, name=name, state=state, url=url, timeout=timeout, stdout=out, stderr=err)\n\nfrom ansible.module_utils.basic import *\n\nmain()\n", "path": "packaging/elasticsearch_plugin.py"}], "after_files": [{"content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport os\n\n\"\"\"\nAnsible module to manage elasticsearch plugins\n(c) 2015, Mathew Davies <thepixeldeveloper@googlemail.com>\n\nThis file is part of Ansible\n\nAnsible is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nAnsible is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\nYou should have received a copy of the GNU General Public License\nalong with Ansible.  If not, see <http://www.gnu.org/licenses/>.\n\"\"\"\n\nDOCUMENTATION = '''\n---\nmodule: elasticsearch_plugin\nshort_description: Manage Elasticsearch plugins\ndescription:\n    - Manages Elasticsearch plugins.\nversion_added: \"2.0\"\nauthor: Mathew Davies (@ThePixelDeveloper)\noptions:\n    name:\n        description:\n            - Name of the plugin to install. In ES 2.x, the name can be an url or file location\n        required: True\n    state:\n        description:\n            - Desired state of a plugin.\n        required: False\n        choices: [present, absent]\n        default: present\n    url:\n        description:\n            - Set exact URL to download the plugin from (Only works for ES 1.x)\n        required: False\n        default: None\n    timeout:\n        description:\n            - \"Timeout setting: 30s, 1m, 1h...\"\n        required: False\n        default: 1m\n    plugin_bin:\n        description:\n            - Location of the plugin binary\n        required: False\n        default: /usr/share/elasticsearch/bin/plugin\n    plugin_dir:\n        description:\n            - Your configured plugin directory specified in Elasticsearch\n        required: False\n        default: /usr/share/elasticsearch/plugins/\n    version:\n        description:\n            - Version of the plugin to be installed.\n              If plugin exists with previous version, it will NOT be updated\n        required: False\n        default: None\n'''\n\nEXAMPLES = '''\n# Install Elasticsearch head plugin\n- elasticsearch_plugin: state=present name=\"mobz/elasticsearch-head\"\n\n# Install specific version of a plugin\n- elasticsearch_plugin: state=present name=\"com.github.kzwang/elasticsearch-image\" version=\"1.2.0\"\n\n# Uninstall Elasticsearch head plugin\n- elasticsearch_plugin: state=absent name=\"mobz/elasticsearch-head\"\n'''\n\n\ndef parse_plugin_repo(string):\n    elements = string.split(\"/\")\n\n    # We first consider the simplest form: pluginname\n    repo = elements[0]\n\n    # We consider the form: username/pluginname\n    if len(elements) > 1:\n        repo = elements[1]\n\n    # remove elasticsearch- prefix\n    # remove es- prefix\n    for string in (\"elasticsearch-\", \"es-\"):\n        if repo.startswith(string):\n            return repo[len(string):]\n\n    return repo\n\n\ndef is_plugin_present(plugin_dir, working_dir):\n    return os.path.isdir(os.path.join(working_dir, plugin_dir))\n\n\ndef parse_error(string):\n    reason = \"reason: \"\n    return string[string.index(reason) + len(reason):].strip()\n\n\ndef main():\n\n    package_state_map = dict(\n        present=\"install\",\n        absent=\"remove\"\n    )\n\n    module = AnsibleModule(\n        argument_spec=dict(\n            name=dict(required=True),\n            state=dict(default=\"present\", choices=package_state_map.keys()),\n            url=dict(default=None),\n            timeout=dict(default=\"1m\"),\n            plugin_bin=dict(default=\"/usr/share/elasticsearch/bin/plugin\"),\n            plugin_dir=dict(default=\"/usr/share/elasticsearch/plugins/\"),\n            version=dict(default=None)\n        )\n    )\n\n    plugin_bin = module.params[\"plugin_bin\"]\n    plugin_dir = module.params[\"plugin_dir\"]\n    name = module.params[\"name\"]\n    state = module.params[\"state\"]\n    url = module.params[\"url\"]\n    timeout = module.params[\"timeout\"]\n    version = module.params[\"version\"]\n\n    present = is_plugin_present(parse_plugin_repo(name), plugin_dir)\n\n    # skip if the state is correct\n    if (present and state == \"present\") or (state == \"absent\" and not present):\n        module.exit_json(changed=False, name=name)\n\n    if (version):\n       name = name + '/' + version\n\n    cmd_args = [plugin_bin, package_state_map[state], name]\n\n    if url:\n        cmd_args.append(\"--url %s\" % url)\n\n    if timeout:\n        cmd_args.append(\"--timeout %s\" % timeout)\n\n    cmd = \" \".join(cmd_args)\n\n    rc, out, err = module.run_command(cmd)\n\n    if rc != 0:\n        reason = parse_error(out)\n        module.fail_json(msg=reason)\n\n    module.exit_json(changed=True, cmd=cmd, name=name, state=state, url=url, timeout=timeout, stdout=out, stderr=err)\n\nfrom ansible.module_utils.basic import *\n\nmain()\n", "path": "packaging/elasticsearch_plugin.py"}]}