From 014bcad35ba4f6b86e076888c6861a8032b722cc Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Sat, 24 Jun 2017 21:07:23 +0200 Subject: [PATCH] Small fix in the error output (#26004) So I noticed this when doing integration tests: Failed to copy file Could not find a part of the path and this change turns it into: Failed to copy file: Could not find a part of the path I also moved something out of the exception handling. --- lib/ansible/modules/windows/win_copy.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/windows/win_copy.ps1 b/lib/ansible/modules/windows/win_copy.ps1 index e3f081df4f..7a8441205b 100644 --- a/lib/ansible/modules/windows/win_copy.ps1 +++ b/lib/ansible/modules/windows/win_copy.ps1 @@ -78,10 +78,10 @@ Function Copy-File($src, $dest) { if ($src_checksum -ne $dest_checksum) { try { Copy-Item -Path $src -Destination $dest -Force -WhatIf:$check_mode - $result.changed = $true } catch { - Fail-Json $result "Failed to copy file $($_.Exception.Message)" + Fail-Json $result "Failed to copy file: $($_.Exception.Message)" } + $result.changed = $true } # Verify the file we copied is the same