From cafc35fd5b61c01c48a60bcc6ca0f71f19a96318 Mon Sep 17 00:00:00 2001 From: Chris Church Date: Sun, 2 Aug 2015 18:38:29 -0400 Subject: [PATCH] Fix for PowerShell unquote method when passed None. --- lib/ansible/plugins/shell/powershell.py | 1 + .../roles/test_win_template/tasks/main.yml | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/lib/ansible/plugins/shell/powershell.py b/lib/ansible/plugins/shell/powershell.py index 33906b84eb..0e16d34e16 100644 --- a/lib/ansible/plugins/shell/powershell.py +++ b/lib/ansible/plugins/shell/powershell.py @@ -126,6 +126,7 @@ class ShellModule(object): def _unquote(self, value): '''Remove any matching quotes that wrap the given value.''' + value = to_unicode(value or '') m = re.match(r'^\s*?\'(.*?)\'\s*?$', value) if m: return m.group(1) diff --git a/test/integration/roles/test_win_template/tasks/main.yml b/test/integration/roles/test_win_template/tasks/main.yml index 73d4bcb495..c276b8d323 100644 --- a/test/integration/roles/test_win_template/tasks/main.yml +++ b/test/integration/roles/test_win_template/tasks/main.yml @@ -39,6 +39,17 @@ that: - "template_result.changed == true" +- name: fill in a basic template again + win_template: + src: foo.j2 + dest: "{{win_output_dir}}/foo.templated" + register: template_result2 + +- name: verify that the template was not changed + assert: + that: + - "not template_result2|changed" + # VERIFY CONTENTS - name: copy known good into place