We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
size parameter required set to be no when state is absent in os_volume
##### Issue Type:
- Documentation Report
##### Plugin Name:

os_volume 
##### Ansible Version:

```
2.4
```
##### Ansible Configuration:

<!-- Please mention any settings you've changed/added/removed in ansible.cfg
(or using the ANSIBLE_* environment variables). -->
##### Environment:

centos 6
##### Summary:

def _absent_volume(module, cloud):
    try:
        cloud.delete_volume(
            name_or_id=module.params['display_name'],
            wait=module.params['wait'],
            timeout=module.params['timeout'])

No need to add size parameter while calling os_volume as delete_volume function does not need size parameter .   http://docs.ansible.com/ansible/os_volume_module.html  this document needs to be modified. 
size parameter required set to be 'NO' when state is absent in os_volume  
##### Steps To Reproduce:

<!-- For bugs, please show exactly how to reproduce the problem.
For new features, show how the feature would be used.  -->

``````
<!-- (Paste example playbooks or commands here)  -->
``` - name: "Delete Volumes attached"
      os_volume:
        state: "absent"
        display_name: "{{ item.id }}"
        timeout: "360"
        auth:
          auth_url: "{{ openstack_auth_url }}"
          username: "{{ openstack_username }}"
          password: "{{ openstack_password }}"
          project_name: "{{ openstack_tenant }}"
      environment:
        OS_VOLUME_API_VERSION: "1"
        OS_IMAGE_API_VERSION: "1"
        security_groups: default

<!-- You can also paste gist.github.com links for larger files.  -->

##### Expected Results:

<!-- What did you expect to happen when running the steps above?  -->

##### Actual Results:

<!-- What actually happened? If possible run with high verbosity (-vvvv) -->

``````

<!-- (Paste verbatim command output here)  -->

```
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `cloud/openstack/os_volume.py`
Content:
```
1 #!/usr/bin/python
2 
3 # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
4 #
5 # This module is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This software is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this software.  If not, see <http://www.gnu.org/licenses/>.
17 
18 
19 try:
20     import shade
21     HAS_SHADE = True
22 except ImportError:
23     HAS_SHADE = False
24 
25 
26 DOCUMENTATION = '''
27 ---
28 module: os_volume
29 short_description: Create/Delete Cinder Volumes
30 extends_documentation_fragment: openstack
31 version_added: "2.0"
32 author: "Monty Taylor (@emonty)"
33 description:
34    - Create or Remove cinder block storage volumes
35 options:
36    size:
37      description:
38         - Size of volume in GB
39      required: only when state is 'present'
40      default: None
41    display_name:
42      description:
43         - Name of volume
44      required: true
45    display_description:
46      description:
47        - String describing the volume
48      required: false
49      default: None
50    volume_type:
51      description:
52        - Volume type for volume
53      required: false
54      default: None
55    image:
56      description:
57        - Image name or id for boot from volume
58      required: false
59      default: None
60    snapshot_id:
61      description:
62        - Volume snapshot id to create from
63      required: false
64      default: None
65    state:
66      description:
67        - Should the resource be present or absent.
68      choices: [present, absent]
69      default: present
70 requirements:
71      - "python >= 2.6"
72      - "shade"
73 '''
74 
75 EXAMPLES = '''
76 # Creates a new volume
77 - name: create a volume
78   hosts: localhost
79   tasks:
80   - name: create 40g test volume
81     os_volume:
82       state: present
83       cloud: mordred
84       availability_zone: az2
85       size: 40
86       display_name: test_volume
87 '''
88 
89 
90 def _present_volume(module, cloud):
91     if cloud.volume_exists(module.params['display_name']):
92         v = cloud.get_volume(module.params['display_name'])
93         module.exit_json(changed=False, id=v['id'], volume=v)
94 
95     volume_args = dict(
96         size=module.params['size'],
97         volume_type=module.params['volume_type'],
98         display_name=module.params['display_name'],
99         display_description=module.params['display_description'],
100         snapshot_id=module.params['snapshot_id'],
101         availability_zone=module.params['availability_zone'],
102     )
103     if module.params['image']:
104         image_id = cloud.get_image_id(module.params['image'])
105         volume_args['imageRef'] = image_id
106 
107     volume = cloud.create_volume(
108         wait=module.params['wait'], timeout=module.params['timeout'],
109         **volume_args)
110     module.exit_json(changed=True, id=volume['id'], volume=volume)
111 
112 
113 def _absent_volume(module, cloud):
114     try:
115         cloud.delete_volume(
116             name_or_id=module.params['display_name'],
117             wait=module.params['wait'],
118             timeout=module.params['timeout'])
119     except shade.OpenStackCloudTimeout:
120         module.exit_json(changed=False)
121     module.exit_json(changed=True)
122 
123 
124 def main():
125     argument_spec = openstack_full_argument_spec(
126         size=dict(default=None),
127         volume_type=dict(default=None),
128         display_name=dict(required=True, aliases=['name']),
129         display_description=dict(default=None, aliases=['description']),
130         image=dict(default=None),
131         snapshot_id=dict(default=None),
132         state=dict(default='present', choices=['absent', 'present']),
133     )
134     module_kwargs = openstack_module_kwargs(
135         mutually_exclusive=[
136             ['image', 'snapshot_id'],
137         ],
138     )
139     module = AnsibleModule(argument_spec=argument_spec, **module_kwargs)
140 
141     if not HAS_SHADE:
142         module.fail_json(msg='shade is required for this module')
143 
144     state = module.params['state']
145 
146     if state == 'present' and not module.params['size']:
147         module.fail_json(msg="Size is required when state is 'present'")
148 
149     try:
150         cloud = shade.openstack_cloud(**module.params)
151         if state == 'present':
152             _present_volume(module, cloud)
153         if state == 'absent':
154             _absent_volume(module, cloud)
155     except shade.OpenStackCloudException as e:
156         module.fail_json(msg=str(e))
157 
158 # this is magic, see lib/ansible/module_common.py
159 from ansible.module_utils.basic import *
160 from ansible.module_utils.openstack import *
161 if __name__ == '__main__':
162     main()
163
```
--- 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/cloud/openstack/os_volume.py b/cloud/openstack/os_volume.py
--- a/cloud/openstack/os_volume.py
+++ b/cloud/openstack/os_volume.py
@@ -35,8 +35,9 @@
 options:
    size:
      description:
-        - Size of volume in GB
-     required: only when state is 'present'
+        - Size of volume in GB. This parameter is required when the
+          I(state) parameter is 'present'.
+     required: false
      default: None
    display_name:
      description:

{"golden_diff": "diff --git a/cloud/openstack/os_volume.py b/cloud/openstack/os_volume.py\n--- a/cloud/openstack/os_volume.py\n+++ b/cloud/openstack/os_volume.py\n@@ -35,8 +35,9 @@\n options:\n    size:\n      description:\n-        - Size of volume in GB\n-     required: only when state is 'present'\n+        - Size of volume in GB. This parameter is required when the\n+          I(state) parameter is 'present'.\n+     required: false\n      default: None\n    display_name:\n      description:\n", "issue": "size parameter required set to be no when state is absent in os_volume\n##### Issue Type:\n- Documentation Report\n##### Plugin Name:\n\nos_volume \n##### Ansible Version:\n\n```\n2.4\n```\n##### Ansible Configuration:\n\n<!-- Please mention any settings you've changed/added/removed in ansible.cfg\n(or using the ANSIBLE_* environment variables). -->\n##### Environment:\n\ncentos 6\n##### Summary:\n\ndef _absent_volume(module, cloud):\n    try:\n        cloud.delete_volume(\n            name_or_id=module.params['display_name'],\n            wait=module.params['wait'],\n            timeout=module.params['timeout'])\n\nNo need to add size parameter while calling os_volume as delete_volume function does not need size parameter .   http://docs.ansible.com/ansible/os_volume_module.html  this document needs to be modified. \nsize parameter required set to be 'NO' when state is absent in os_volume  \n##### Steps To Reproduce:\n\n<!-- For bugs, please show exactly how to reproduce the problem.\nFor new features, show how the feature would be used.  -->\n\n``````\n<!-- (Paste example playbooks or commands here)  -->\n``` - name: \"Delete Volumes attached\"\n      os_volume:\n        state: \"absent\"\n        display_name: \"{{ item.id }}\"\n        timeout: \"360\"\n        auth:\n          auth_url: \"{{ openstack_auth_url }}\"\n          username: \"{{ openstack_username }}\"\n          password: \"{{ openstack_password }}\"\n          project_name: \"{{ openstack_tenant }}\"\n      environment:\n        OS_VOLUME_API_VERSION: \"1\"\n        OS_IMAGE_API_VERSION: \"1\"\n        security_groups: default\n\n<!-- You can also paste gist.github.com links for larger files.  -->\n\n##### Expected Results:\n\n<!-- What did you expect to happen when running the steps above?  -->\n\n##### Actual Results:\n\n<!-- What actually happened? If possible run with high verbosity (-vvvv) -->\n\n``````\n\n<!-- (Paste verbatim command output here)  -->\n\n```\n```\n\n", "before_files": [{"content": "#!/usr/bin/python\n\n# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.\n#\n# This module is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This software is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this software.  If not, see <http://www.gnu.org/licenses/>.\n\n\ntry:\n    import shade\n    HAS_SHADE = True\nexcept ImportError:\n    HAS_SHADE = False\n\n\nDOCUMENTATION = '''\n---\nmodule: os_volume\nshort_description: Create/Delete Cinder Volumes\nextends_documentation_fragment: openstack\nversion_added: \"2.0\"\nauthor: \"Monty Taylor (@emonty)\"\ndescription:\n   - Create or Remove cinder block storage volumes\noptions:\n   size:\n     description:\n        - Size of volume in GB\n     required: only when state is 'present'\n     default: None\n   display_name:\n     description:\n        - Name of volume\n     required: true\n   display_description:\n     description:\n       - String describing the volume\n     required: false\n     default: None\n   volume_type:\n     description:\n       - Volume type for volume\n     required: false\n     default: None\n   image:\n     description:\n       - Image name or id for boot from volume\n     required: false\n     default: None\n   snapshot_id:\n     description:\n       - Volume snapshot id to create from\n     required: false\n     default: None\n   state:\n     description:\n       - Should the resource be present or absent.\n     choices: [present, absent]\n     default: present\nrequirements:\n     - \"python >= 2.6\"\n     - \"shade\"\n'''\n\nEXAMPLES = '''\n# Creates a new volume\n- name: create a volume\n  hosts: localhost\n  tasks:\n  - name: create 40g test volume\n    os_volume:\n      state: present\n      cloud: mordred\n      availability_zone: az2\n      size: 40\n      display_name: test_volume\n'''\n\n\ndef _present_volume(module, cloud):\n    if cloud.volume_exists(module.params['display_name']):\n        v = cloud.get_volume(module.params['display_name'])\n        module.exit_json(changed=False, id=v['id'], volume=v)\n\n    volume_args = dict(\n        size=module.params['size'],\n        volume_type=module.params['volume_type'],\n        display_name=module.params['display_name'],\n        display_description=module.params['display_description'],\n        snapshot_id=module.params['snapshot_id'],\n        availability_zone=module.params['availability_zone'],\n    )\n    if module.params['image']:\n        image_id = cloud.get_image_id(module.params['image'])\n        volume_args['imageRef'] = image_id\n\n    volume = cloud.create_volume(\n        wait=module.params['wait'], timeout=module.params['timeout'],\n        **volume_args)\n    module.exit_json(changed=True, id=volume['id'], volume=volume)\n\n\ndef _absent_volume(module, cloud):\n    try:\n        cloud.delete_volume(\n            name_or_id=module.params['display_name'],\n            wait=module.params['wait'],\n            timeout=module.params['timeout'])\n    except shade.OpenStackCloudTimeout:\n        module.exit_json(changed=False)\n    module.exit_json(changed=True)\n\n\ndef main():\n    argument_spec = openstack_full_argument_spec(\n        size=dict(default=None),\n        volume_type=dict(default=None),\n        display_name=dict(required=True, aliases=['name']),\n        display_description=dict(default=None, aliases=['description']),\n        image=dict(default=None),\n        snapshot_id=dict(default=None),\n        state=dict(default='present', choices=['absent', 'present']),\n    )\n    module_kwargs = openstack_module_kwargs(\n        mutually_exclusive=[\n            ['image', 'snapshot_id'],\n        ],\n    )\n    module = AnsibleModule(argument_spec=argument_spec, **module_kwargs)\n\n    if not HAS_SHADE:\n        module.fail_json(msg='shade is required for this module')\n\n    state = module.params['state']\n\n    if state == 'present' and not module.params['size']:\n        module.fail_json(msg=\"Size is required when state is 'present'\")\n\n    try:\n        cloud = shade.openstack_cloud(**module.params)\n        if state == 'present':\n            _present_volume(module, cloud)\n        if state == 'absent':\n            _absent_volume(module, cloud)\n    except shade.OpenStackCloudException as e:\n        module.fail_json(msg=str(e))\n\n# this is magic, see lib/ansible/module_common.py\nfrom ansible.module_utils.basic import *\nfrom ansible.module_utils.openstack import *\nif __name__ == '__main__':\n    main()\n", "path": "cloud/openstack/os_volume.py"}], "after_files": [{"content": "#!/usr/bin/python\n\n# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.\n#\n# This module is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This software is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this software.  If not, see <http://www.gnu.org/licenses/>.\n\n\ntry:\n    import shade\n    HAS_SHADE = True\nexcept ImportError:\n    HAS_SHADE = False\n\n\nDOCUMENTATION = '''\n---\nmodule: os_volume\nshort_description: Create/Delete Cinder Volumes\nextends_documentation_fragment: openstack\nversion_added: \"2.0\"\nauthor: \"Monty Taylor (@emonty)\"\ndescription:\n   - Create or Remove cinder block storage volumes\noptions:\n   size:\n     description:\n        - Size of volume in GB. This parameter is required when the\n          I(state) parameter is 'present'.\n     required: false\n     default: None\n   display_name:\n     description:\n        - Name of volume\n     required: true\n   display_description:\n     description:\n       - String describing the volume\n     required: false\n     default: None\n   volume_type:\n     description:\n       - Volume type for volume\n     required: false\n     default: None\n   image:\n     description:\n       - Image name or id for boot from volume\n     required: false\n     default: None\n   snapshot_id:\n     description:\n       - Volume snapshot id to create from\n     required: false\n     default: None\n   state:\n     description:\n       - Should the resource be present or absent.\n     choices: [present, absent]\n     default: present\nrequirements:\n     - \"python >= 2.6\"\n     - \"shade\"\n'''\n\nEXAMPLES = '''\n# Creates a new volume\n- name: create a volume\n  hosts: localhost\n  tasks:\n  - name: create 40g test volume\n    os_volume:\n      state: present\n      cloud: mordred\n      availability_zone: az2\n      size: 40\n      display_name: test_volume\n'''\n\n\ndef _present_volume(module, cloud):\n    if cloud.volume_exists(module.params['display_name']):\n        v = cloud.get_volume(module.params['display_name'])\n        module.exit_json(changed=False, id=v['id'], volume=v)\n\n    volume_args = dict(\n        size=module.params['size'],\n        volume_type=module.params['volume_type'],\n        display_name=module.params['display_name'],\n        display_description=module.params['display_description'],\n        snapshot_id=module.params['snapshot_id'],\n        availability_zone=module.params['availability_zone'],\n    )\n    if module.params['image']:\n        image_id = cloud.get_image_id(module.params['image'])\n        volume_args['imageRef'] = image_id\n\n    volume = cloud.create_volume(\n        wait=module.params['wait'], timeout=module.params['timeout'],\n        **volume_args)\n    module.exit_json(changed=True, id=volume['id'], volume=volume)\n\n\ndef _absent_volume(module, cloud):\n    try:\n        cloud.delete_volume(\n            name_or_id=module.params['display_name'],\n            wait=module.params['wait'],\n            timeout=module.params['timeout'])\n    except shade.OpenStackCloudTimeout:\n        module.exit_json(changed=False)\n    module.exit_json(changed=True)\n\n\ndef main():\n    argument_spec = openstack_full_argument_spec(\n        size=dict(default=None),\n        volume_type=dict(default=None),\n        display_name=dict(required=True, aliases=['name']),\n        display_description=dict(default=None, aliases=['description']),\n        image=dict(default=None),\n        snapshot_id=dict(default=None),\n        state=dict(default='present', choices=['absent', 'present']),\n    )\n    module_kwargs = openstack_module_kwargs(\n        mutually_exclusive=[\n            ['image', 'snapshot_id'],\n        ],\n    )\n    module = AnsibleModule(argument_spec=argument_spec, **module_kwargs)\n\n    if not HAS_SHADE:\n        module.fail_json(msg='shade is required for this module')\n\n    state = module.params['state']\n\n    if state == 'present' and not module.params['size']:\n        module.fail_json(msg=\"Size is required when state is 'present'\")\n\n    try:\n        cloud = shade.openstack_cloud(**module.params)\n        if state == 'present':\n            _present_volume(module, cloud)\n        if state == 'absent':\n            _absent_volume(module, cloud)\n    except shade.OpenStackCloudException as e:\n        module.fail_json(msg=str(e))\n\n# this is magic, see lib/ansible/module_common.py\nfrom ansible.module_utils.basic import *\nfrom ansible.module_utils.openstack import *\nif __name__ == '__main__':\n    main()\n", "path": "cloud/openstack/os_volume.py"}]}