From 96da0047acc3e8da862ff371c21d7ba2b0bb8a97 Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Tue, 22 Aug 2017 13:03:32 +0200 Subject: [PATCH] Fix an issue causing win_copy to fail It seems win_copy can fail because `will_change` was not returned in the dictionary when doing a query. This is an easy fix to get it working again. --- lib/ansible/plugins/action/win_copy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/plugins/action/win_copy.py b/lib/ansible/plugins/action/win_copy.py index c97049b523..e753d278aa 100644 --- a/lib/ansible/plugins/action/win_copy.py +++ b/lib/ansible/plugins/action/win_copy.py @@ -479,13 +479,13 @@ class ActionModule(ActionBase): result.update(query_return) return result - if query_return['will_change'] is False: + if query_return.get('will_change') is False: # no changes need to occur result['failed'] = False result['changed'] = False return result - if query_return['zip_available'] is True and result['operation'] != 'file_copy': + if query_return.get('zip_available') is True and result['operation'] != 'file_copy': # if the PS zip utils are available and we need to copy more than a # single file/folder, create a local zip file of all the changed # files and send that to the server to be expanded