win_uri: fix creates/remotes - manual cherry-picking for pull 36016 for stable-2.4

This commit is contained in:
Jordan Borean 2018-02-15 07:21:49 +11:00
parent cc7dfdeb52
commit f37cba14ac
No known key found for this signature in database
GPG key ID: 2AAC89085FBBDAB5

View file

@ -54,6 +54,14 @@ $use_basic_parsing = Get-AnsibleParam -obj $params -name "use_basic_parsing" -ty
$validate_certs = Get-AnsibleParam -obj $params -name "validate_certs" -type "bool" -default $true
$client_cert = Get-AnsibleParam -obj $params -name "client_cert" -type "path"
$result = @{
changed = $false
content_type = $content_type
method = $method
url = $url
use_basic_parsing = $use_basic_parsing
}
if ($creates -and (Test-Path -Path $creates)) {
$result.skipped = $true
Exit-Json $result "The 'creates' file or directory ($creates) already exists."
@ -64,14 +72,6 @@ if ($removes -and -not (Test-Path -Path $removes)) {
Exit-Json $result "The 'removes' file or directory ($removes) does not exist."
}
$result = @{
changed = $false
content_type = $content_type
method = $method
url = $url
use_basic_parsing = $use_basic_parsing
}
# Disable redirection if requested
switch($follow_redirects) {
"none" {