mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
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.
This commit is contained in:
parent
21c7fcf9c0
commit
014bcad35b
1 changed files with 2 additions and 2 deletions
|
@ -78,10 +78,10 @@ Function Copy-File($src, $dest) {
|
||||||
if ($src_checksum -ne $dest_checksum) {
|
if ($src_checksum -ne $dest_checksum) {
|
||||||
try {
|
try {
|
||||||
Copy-Item -Path $src -Destination $dest -Force -WhatIf:$check_mode
|
Copy-Item -Path $src -Destination $dest -Force -WhatIf:$check_mode
|
||||||
$result.changed = $true
|
|
||||||
} catch {
|
} 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
|
# Verify the file we copied is the same
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue