mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
fix win_shell/win_command nonzero RC failure setting (#26443)
* as a result of recent core engine changes to ignore rc, modules are responsible to set `failed` on nonzero RC if they want that behavior * the `failed` filter currently triggers on nonzero RC, which caused the tests to false-pass * updated tests to explicitly check both rc and failed keys, as well as using the failed filter.
This commit is contained in:
@@ -159,6 +159,10 @@ $proc.WaitForExit() | Out-Null
|
||||
|
||||
$result.rc = $proc.ExitCode
|
||||
|
||||
If ($result.rc -ne 0) {
|
||||
$result.failed = $true
|
||||
}
|
||||
|
||||
$end_datetime = [DateTime]::UtcNow
|
||||
|
||||
$result.start = $start_datetime.ToString("yyyy-MM-dd hh:mm:ss.ffffff")
|
||||
|
||||
@@ -168,6 +168,10 @@ $proc.WaitForExit() | Out-Null
|
||||
|
||||
$result.rc = $proc.ExitCode
|
||||
|
||||
If ($result.rc -ne 0) {
|
||||
$result.failed = $true
|
||||
}
|
||||
|
||||
$end_datetime = [DateTime]::UtcNow
|
||||
|
||||
$result.start = $start_datetime.ToString("yyyy-MM-dd hh:mm:ss.ffffff")
|
||||
|
||||
Reference in New Issue
Block a user