internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: ansible/ansible

Issue:
Fix ios_banner integration test issue
<!---
Verify first that your issue/request is not already reported on GitHub.
Also test if the latest release, and master branch are affected too.
-->

##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Bug Report

##### COMPONENT NAME
<!--- Name of the module/plugin/task/feature -->
ios_banner

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes below -->
```
2.5
```

##### CONFIGURATION
<!---
If using Ansible 2.4 or above, paste the results of "ansible-config dump --only-changed"

Otherwise, mention any settings you have changed/added/removed in ansible.cfg
(or using the ANSIBLE_* environment variables).

-->

##### OS / ENVIRONMENT
<!---
Mention the OS you are running Ansible from, and the OS you are
managing, or say "N/A" for anything that is not platform-specific.
Also mention the specific version of what you are trying to control,
e.g. if this is a network bug the version of firmware on the network device.
-->

##### SUMMARY
<!--- Explain the problem briefly -->

##### STEPS TO REPRODUCE
<!---
For bugs, show exactly how to reproduce the problem, using a minimal test-case.
For new features, show how the feature would be used.
-->

<!--- Paste example playbooks or commands between quotes below -->
```yaml
---
- name: Setup
  ios_banner:
    banner: login
    text: |
      Junk login banner
      over multiple lines
    state: present
    authorize: yes

- name: remove login
  ios_banner:
    banner: login
    state: absent
    authorize: yes
  register: result

- debug:
    msg: "{{ result }}"

- assert:
    that:
      - "result.changed == true"
      - "'no banner login' in result.commands" # does this break due to "contains?"

- name: remove login (idempotent)
  ios_banner:
    banner: login
    state: absent
    authorize: yes
  register: result

- assert:
    that:
      - "result.changed == false"
      - "result.commands | length == 0"

```

<!--- You can also paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
<!--- What did you expect to happen when running the steps above? -->
Should run sucessfully
##### ACTUAL RESULTS
<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->

<!--- Paste verbatim command output between quotes below -->
```
task path: /Users/gnalawad/ansible/ganeshrn/ansible/test/integration/targets/ios_banner/tests/cli/basic-no-login.yaml:33
fatal: [an-ios-02]: FAILED! => {
    "assertion": "result.changed == false",
    "changed": false,
    "evaluated_to": false
}
```



Discussion:

Resolving patch:
diff --git a/lib/ansible/utils/jsonrpc.py b/lib/ansible/utils/jsonrpc.py
--- a/lib/ansible/utils/jsonrpc.py
+++ b/lib/ansible/utils/jsonrpc.py
@@ -83,7 +83,7 @@ def header(self):
 
     def response(self, result=None):
         response = self.header()
-        response['result'] = result or 'ok'
+        response['result'] = result
         return response
 
     def error(self, code, message, data=None):


Test patch:
Repository: ansible/ansible

Issue:
add cmd parameter + example to shell (and/or command?)
##### ISSUE TYPE
 - Documentation Report

##### COMPONENT NAME
shell

##### ANSIBLE VERSION
```
ansible-playbook 2.4.1.0
  config file = 
  configured module search path = [u'/Users/lynchg/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/lynchg/.virtualenvs/a2x/lib/python2.7/site-packages/ansible
  executable location = /Users/lynchg/.virtualenvs/a2x/bin/ansible-playbook
  python version = 2.7.13 (default, Dec 18 2016, 07:03:34) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)]
```

##### CONFIGURATION
NA

##### OS / ENVIRONMENT
NA

##### SUMMARY
When outputting heredocs using shell, it's necessary to use
```
- shell:
    cmd: |
      cat <<EOF
      This is a test.
      EOF
```
But this `cmd` param is not documented _anywhere_.

##### STEPS TO REPRODUCE
```
- hosts: localhost
  gather_facts: False
  connection: local
  tasks:
    - shell:
        cmd: |
          cat <<EOF
          This is a test.
          EOF
      register: result

    - debug:
        var: result
```

##### EXPECTED RESULTS
A `cmd` param should be listed in the `command` and/or `shell` modules.  It should also be listed as a possible argument.

##### ACTUAL RESULTS
It's not mentioned anywhere.  I found it from a stackoverflow answer - https://stackoverflow.com/a/40230416/4721729



Discussion:

Resolving patch:
diff --git a/lib/ansible/modules/commands/shell.py b/lib/ansible/modules/commands/shell.py
--- a/lib/ansible/modules/commands/shell.py
+++ b/lib/ansible/modules/commands/shell.py
@@ -67,14 +67,16 @@
     required: false
     default: null
 notes:
-   -  If you want to execute a command securely and predictably, it may be
-      better to use the M(command) module instead. Best practices when writing
-      playbooks will follow the trend of using M(command) unless the C(shell)
-      module is explicitly required. When running ad-hoc commands, use your best
-      judgement.
-   -  To sanitize any variables passed to the shell module, you should use
-      "{{ var | quote }}" instead of just "{{ var }}" to make sure they don't include evil things like semicolons.
-   - For Windows targets, use the M(win_shell) module instead.
+  -  If you want to execute a command securely and predictably, it may be
+     better to use the M(command) module instead. Best practices when writing
+     playbooks will follow the trend of using M(command) unless the C(shell)
+     module is explicitly required. When running ad-hoc commands, use your best
+     judgement.
+  -  To sanitize any variables passed to the shell module, you should use
+     "{{ var | quote }}" instead of just "{{ var }}" to make sure they don't include evil things like semicolons.
+  - For Windows targets, use the M(win_shell) module instead.
+  - Rather than using here documents to create multi-line scripts inside playbooks,
+    use the M(script) module instead.
 requirements: [ ]
 author:
     - Ansible Core Team


Test patch:
Repository: ansible/ansible

Issue:
cannot pass `enable` as a valid become method from cli
```
$ ansible-playbook facts.yaml -u ansible -k --become --become-method enable
Usage: ansible-playbook [options] playbook.yml [playbook2 ...]

ansible-playbook: error: option --become-method: invalid choice: u'enable' (choose from 'sudo', 'su', 'pbrun', 'pfexec', 'doas', 'dzdo', 'ksu', 'runas', 'pmrun')
```


Discussion:
@privateip Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information. 

Here are the items we could not find in your description:
- issue type
- ansible version
- component name

Please set the description of this issue with this template:
https://raw.githubusercontent.com/ansible/ansible/devel/.github/ISSUE_TEMPLATE.md

[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: issue_missing_data --->

Resolving patch:
diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py
--- a/lib/ansible/constants.py
+++ b/lib/ansible/constants.py
@@ -59,7 +59,7 @@ def set_constant(name, value, export=vars()):
 
 
 # CONSTANTS ### yes, actual ones
-BECOME_METHODS = ['sudo', 'su', 'pbrun', 'pfexec', 'doas', 'dzdo', 'ksu', 'runas', 'pmrun']
+BECOME_METHODS = ['sudo', 'su', 'pbrun', 'pfexec', 'doas', 'dzdo', 'ksu', 'runas', 'pmrun', 'enable']
 BECOME_ERROR_STRINGS = {
     'sudo': 'Sorry, try again.',
     'su': 'Authentication failure',
@@ -68,7 +68,8 @@ def set_constant(name, value, export=vars()):
     'doas': 'Permission denied',
     'dzdo': '',
     'ksu': 'Password incorrect',
-    'pmrun': 'You are not permitted to run this command'
+    'pmrun': 'You are not permitted to run this command',
+    'enable': '',
 }  # FIXME: deal with i18n
 BECOME_MISSING_STRINGS = {
     'sudo': 'sorry, a password is required to run sudo',
@@ -78,7 +79,8 @@ def set_constant(name, value, export=vars()):
     'doas': 'Authorization required',
     'dzdo': '',
     'ksu': 'No password given',
-    'pmrun': ''
+    'pmrun': '',
+    'enable': '',
 }  # FIXME: deal with i18n
 BLACKLIST_EXTS = ('.pyc', '.pyo', '.swp', '.bak', '~', '.rpm', '.md', '.txt')
 BOOL_TRUE = BOOLEANS_TRUE
diff --git a/lib/ansible/plugins/connection/network_cli.py b/lib/ansible/plugins/connection/network_cli.py
--- a/lib/ansible/plugins/connection/network_cli.py
+++ b/lib/ansible/plugins/connection/network_cli.py
@@ -116,7 +116,7 @@ def exec_command(self, cmd, in_data=None, sudoable=True):
                 cmd = json.loads(to_text(cmd, errors='surrogate_or_strict'))
                 kwargs = {'command': to_bytes(cmd['command'], errors='surrogate_or_strict')}
                 for key in ('prompt', 'answer', 'send_only'):
-                    if key in cmd:
+                    if cmd.get(key) is not None:
                         kwargs[key] = to_bytes(cmd[key], errors='surrogate_or_strict')
                 return self.send(**kwargs)
             except ValueError:


Test patch:
Repository: ansible/ansible

Issue:
The quote filter fails on integers
##### ISSUE TYPE
Bug Report

##### COMPONENT NAME
shell

##### ANSIBLE VERSION
```
ansible 2.5.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/foo/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.14 (default, Sep 20 2017, 01:25:59) [GCC 7.2.0]
```
2.5.0.34173.3d63ecb6f3-1

##### CONFIGURATION
DEFAULT_STDOUT_CALLBACK(/etc/ansible/ansible.cfg) = debug

##### OS / ENVIRONMENT
N/A

##### SUMMARY
I was expecting the `quote` filter to work with integers, without an explicit cast. It does not.

##### STEPS TO REPRODUCE
```
ansible -m shell -a 'echo {{ 42|quote }}' localhost
```

##### EXPECTED RESULTS
Success.

##### ACTUAL RESULTS
Failure.
```
Unexpected templating type error occurred on (echo {{ 42|quote }}): 'int' object is not iterable
```


Discussion:
Files identified in the description:
* [lib/ansible/modules/commands/shell.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/commands/shell.py)

If these files are inaccurate, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
If this is considered intended behavior, then at least the error message should be improved. When this failed for me the first time, it was in a task with 14 quoted variables. Took a while to figure out where exactly the problem was.

Resolving patch:
diff --git a/lib/ansible/plugins/filter/core.py b/lib/ansible/plugins/filter/core.py
--- a/lib/ansible/plugins/filter/core.py
+++ b/lib/ansible/plugins/filter/core.py
@@ -141,7 +141,7 @@ def strftime(string_format, second=None):
 
 def quote(a):
     ''' return its argument quoted for shell usage '''
-    return shlex_quote(a)
+    return shlex_quote(to_text(a))
 
 
 def fileglob(pathname):


Test patch:
Repository: ansible/ansible

Issue:
Documentation typo in github_release
##### ISSUE TYPE
- Documentation Report

##### COMPONENT NAME
/lib/ansible/modules/source_control/github_release.py

##### ANSIBLE VERSION
Version currently in "devel" branch: https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/source_control/github_release.py

##### CONFIGURATION
not applicable

##### OS / ENVIRONMENT
not applicable

##### SUMMARY
The examples contain:
```
...
- name: Create a new release
  github:
    token: tokenabc1234567890
...
```

(the module name is github, which does not exist.)

##### STEPS TO REPRODUCE
Not applicable

##### EXPECTED RESULTS
```
...
- name: Create a new release
  github_release:
    token: tokenabc1234567890
...
```

##### ACTUAL RESULTS
Not applicable.

I'll make a merge request and relate it to this issue.


Discussion:

Resolving patch:
diff --git a/lib/ansible/modules/source_control/github_release.py b/lib/ansible/modules/source_control/github_release.py
--- a/lib/ansible/modules/source_control/github_release.py
+++ b/lib/ansible/modules/source_control/github_release.py
@@ -103,7 +103,7 @@
     action: latest_release
 
 - name: Create a new release
-  github:
+  github_release:
     token: tokenabc1234567890
     user: testuser
     repo: testrepo


Test patch:
Repository: ansible/ansible

Issue:
get_url doesn't remove temp file when force=yes and changed=no

##### ISSUE TYPE
Bug Report

##### COMPONENT NAME
get_url

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes below -->
```
ansible 2.4.1.0
  config file = None
  configured module search path = [u'/home/me/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /path/to/virtualenv/ansible/local/lib/python2.7/site-packages/ansible
  executable location = /path/to/virtualenv/ansible/bin/ansible
  python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
```

##### CONFIGURATION
Default configuration

##### OS / ENVIRONMENT
Ansible run on Ubuntu 16.04, managing RedHat 6.6

##### SUMMARY
<!--- Explain the problem briefly -->
get_url doesn't remove temporary file when `force=yes` and destination file checksum is equal to downloaded file checksum.

##### STEPS TO REPRODUCE
Just run this playbook:

```yaml
---
- hosts: all
  tasks:
  - get_url:
      url: http://www.acme.com/file.txt
      dest: /path/to/file.txt
      force: yes
```

##### EXPECTED RESULTS
Temporary file should be removed.

##### ACTUAL RESULTS
Temporary file is not removed.



Discussion:
Files identified in the description:
* [lib/ansible/modules/net_tools/basics/get_url.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/net_tools/basics/get_url.py)

If these files are inaccurate, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @jpmens
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: notify --->

Resolving patch:
diff --git a/lib/ansible/modules/net_tools/basics/get_url.py b/lib/ansible/modules/net_tools/basics/get_url.py
--- a/lib/ansible/modules/net_tools/basics/get_url.py
+++ b/lib/ansible/modules/net_tools/basics/get_url.py
@@ -538,6 +538,8 @@ def main():
         changed = True
     else:
         changed = False
+        if os.path.exists(tmpsrc):
+            os.remove(tmpsrc)
 
     if checksum != '':
         destination_checksum = module.digest_from_file(dest, algorithm)


Test patch:
Repository: ansible/ansible

Issue:
Radware vdirect_runnable module does not treat the delete action for workflow in a proper way
##### ISSUE TYPE
 - Bug Report

##### COMPONENT NAME
module network/radware/vdirect_runnable

##### ANSIBLE VERSION
ansible 2.4

##### SUMMARY
When running the delete action on "workflow" type runnable, the returned 404 status code is considered as a failure. It should not. the delete action deletes the runnable and returned 404 code is a valid code in this case. this code is returned as a result of runnable existance check.

##### STEPS TO REPRODUCE
create a workflow runnable.
run the delete action on this runnable.
The runnable will be successfully deleted but the module will return failure because the 404 status code considered as invalid.

##### EXPECTED RESULTS
module should return success in this case




Discussion:
Files identified in the description:
* [lib/ansible/modules/network/radware/vdirect_runnable.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/network/radware/vdirect_runnable.py)

If these files are inaccurate, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->

Resolving patch:
diff --git a/lib/ansible/modules/network/radware/vdirect_runnable.py b/lib/ansible/modules/network/radware/vdirect_runnable.py
--- a/lib/ansible/modules/network/radware/vdirect_runnable.py
+++ b/lib/ansible/modules/network/radware/vdirect_runnable.py
@@ -294,7 +294,7 @@ def run(self):
         result = self.client.runnable.run(data, self.type, self.name, self.action_name)
         result_to_return = {'msg': ''}
         if result[rest_client.RESP_STATUS] == 200:
-            if result[rest_client.RESP_DATA]['status'] == 200 and result[rest_client.RESP_DATA]['success']:
+            if result[rest_client.RESP_DATA]['success']:
                 if self.type == WORKFLOW_TEMPLATE_RUNNABLE_TYPE:
                     result_to_return['msg'] = WORKFLOW_CREATION_SUCCESS
                 elif self.type == CONFIGURATION_TEMPLATE_RUNNABLE_TYPE:


Test patch:
diff --git a/test/units/modules/network/radware/test_vdirect_runnable.py b/test/units/modules/network/radware/test_vdirect_runnable.py
--- a/test/units/modules/network/radware/test_vdirect_runnable.py
+++ b/test/units/modules/network/radware/test_vdirect_runnable.py
@@ -261,6 +261,10 @@ def test_run(self, *args):
             res = vdirectRunnable.run()
             assert res == MODULE_RESULT
 
+            RUN_RESULT[self.module_mock.rest_client.RESP_DATA]['status'] = 404
+            vdirectRunnable.run()
+            assert res == MODULE_RESULT
+
             RUN_RESULT[self.module_mock.rest_client.RESP_STATUS] = 400
             RUN_RESULT[self.module_mock.rest_client.RESP_REASON] = "Reason"
             RUN_RESULT[self.module_mock.rest_client.RESP_STR] = "Details"
Repository: ansible/ansible

Issue:
Radware modules have wrong parameter name in documented example
##### ISSUE TYPE
 - Documentation Report

##### COMPONENT NAME
module network/radware/vdirect_file
module network/radware/vdirect_runnable
module network/radware/vdirect_commit

##### ANSIBLE VERSION
ansible 2.4

##### SUMMARY
in EXAMPLES documentation, the parameter vdirect_primary_ip is wrong. it should be vdirect_ip.



Discussion:
Files identified in the description:
* [lib/ansible/modules/network/radware/vdirect_commit.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/network/radware/vdirect_commit.py)
* [lib/ansible/modules/network/radware/vdirect_file.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/network/radware/vdirect_file.py)
* [lib/ansible/modules/network/radware/vdirect_runnable.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/network/radware/vdirect_runnable.py)

If these files are inaccurate, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
@evgenyfedoruk Will you be raising a PR to fix this?
needs_info
@gundalow Sure, I did not want to PR this one before the previous merges, they touch same file. Now, I will re-base and PR. Thanks for merging it!

Resolving patch:
diff --git a/lib/ansible/modules/network/radware/vdirect_commit.py b/lib/ansible/modules/network/radware/vdirect_commit.py
--- a/lib/ansible/modules/network/radware/vdirect_commit.py
+++ b/lib/ansible/modules/network/radware/vdirect_commit.py
@@ -129,7 +129,7 @@
 EXAMPLES = '''
 - name: vdirect_commit
   vdirect_commit:
-      vdirect_primary_ip: 10.10.10.10
+      vdirect_ip: 10.10.10.10
       vdirect_user: vDirect
       vdirect_password: radware
       devices: ['dev1', 'dev2']
diff --git a/lib/ansible/modules/network/radware/vdirect_file.py b/lib/ansible/modules/network/radware/vdirect_file.py
--- a/lib/ansible/modules/network/radware/vdirect_file.py
+++ b/lib/ansible/modules/network/radware/vdirect_file.py
@@ -106,7 +106,7 @@
 EXAMPLES = '''
 - name: vdirect_file
   vdirect_file:
-      vdirect_primary_ip: 10.10.10.10
+      vdirect_ip: 10.10.10.10
       vdirect_user: vDirect
       vdirect_password: radware
       file_name: /tmp/get_vlans.vm
diff --git a/lib/ansible/modules/network/radware/vdirect_runnable.py b/lib/ansible/modules/network/radware/vdirect_runnable.py
--- a/lib/ansible/modules/network/radware/vdirect_runnable.py
+++ b/lib/ansible/modules/network/radware/vdirect_runnable.py
@@ -121,7 +121,7 @@
 EXAMPLES = '''
 - name: vdirect_runnable
   vdirect_runnable:
-      vdirect_primary_ip: 10.10.10.10
+      vdirect_ip: 10.10.10.10
       vdirect_user: vDirect
       vdirect_password: radware
       runnable_type: ConfigurationTemplate


Test patch:
Repository: ansible/ansible

Issue:
File module exits with stacktrace when touching file with non-existent parent directory
##### ISSUE TYPE
 - Bug Report

##### COMPONENT NAME
file module

##### ANSIBLE VERSION
```
ansible 2.5.0 (devel 326b208b19) last updated 2017/12/10 11:04:06 (GMT +200)
  config file = None
  configured module search path = [u'/Users/Lued/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/Lued/dev/ansible-test/ansible/lib/ansible
  executable location = /Users/Lued/dev/ansible-test/ansible/bin/ansible
  python version = 2.7.10 (default, Feb  7 2017, 00:08:15) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]
```

##### CONFIGURATION
No special configuration.

##### OS / ENVIRONMENT
Ansible control machine: macOS Sierra 10.12.6
Managed OS: Debian Stretch

##### SUMMARY
The file module exits with a stacktrace when a file is touched whose parent directory does not exist.

##### STEPS TO REPRODUCE
```yaml
- hosts: all
  tasks:
    - name: Test touch of file with non-existent parent directory
      file:
        path: /tmp/test/test.txt
        state: touch
```

##### EXPECTED RESULTS
A user friendly error message should state the exception.

##### ACTUAL RESULTS
A stacktrace was printed.

<!--- Paste verbatim command output between quotes below -->
```
fatal: [default]: FAILED! => {
    "changed": false,
    "module_stderr": "Shared connection to 127.0.0.1 closed.\r\n",
    "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_ywVa4b/ansible_module_file.py\", line 468, in <module>\r\n    main()\r\n  File \"/tmp/ansible_ywVa4b/ansible_module_file.py\", line 442, in main\r\n    open(b_path, 'wb').close()\r\nIOError: [Errno 2] No such file or directory: '/tmp/test/test.txt'\r\n",
    "msg": "MODULE FAILURE",
    "rc": 0
}
```



Discussion:
Files identified in the description:
* [lib/ansible/modules/files/file.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/files/file.py)

If these files are inaccurate, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->

Resolving patch:
diff --git a/lib/ansible/modules/files/file.py b/lib/ansible/modules/files/file.py
--- a/lib/ansible/modules/files/file.py
+++ b/lib/ansible/modules/files/file.py
@@ -440,7 +440,7 @@ def main():
             if prev_state == 'absent':
                 try:
                     open(b_path, 'wb').close()
-                except OSError as e:
+                except (OSError, IOError) as e:
                     module.fail_json(path=path, msg='Error, could not touch target: %s' % to_native(e, nonstring='simplerepr'))
             elif prev_state in ('file', 'directory', 'hard'):
                 try:


Test patch: