summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authornitzmahone <mdavis@ansible.com>2016-03-24 20:52:57 -0700
committernitzmahone <mdavis@ansible.com>2016-03-24 20:53:04 -0700
commit06e61cf1db53907fd2aa940c96fce9c10e2c2a51 (patch)
tree7225319d5df6790095ec3cba102e3079df3b460f /windows
parenta2f41dfb043df33a068520634838a32fc695a124 (diff)
downloadansible-modules-core-06e61cf1db53907fd2aa940c96fce9c10e2c2a51.tar.gz
fix win_stat get_checksum alias issue
made it impossible to prevent gathering checksum without setting both get_md5 and get_checksum false
Diffstat (limited to 'windows')
-rw-r--r--windows/win_stat.ps16
1 files changed, 4 insertions, 2 deletions
diff --git a/windows/win_stat.ps1 b/windows/win_stat.ps1
index 4b8f5f6e..06484f3d 100644
--- a/windows/win_stat.ps1
+++ b/windows/win_stat.ps1
@@ -31,7 +31,8 @@ If ($path -eq $FALSE)
}
$get_md5 = Get-Attr $params "get_md5" $TRUE | ConvertTo-Bool;
-$get_checksum = Get-Attr $params "get_checksum" $TRUE | ConvertTo-Bool;
+# until we support real aliasing, get the default value from get_md5
+$get_checksum = Get-Attr $params "get_checksum" $get_md5 | ConvertTo-Bool;
$result = New-Object psobject @{
stat = New-Object psobject
@@ -64,7 +65,8 @@ Else
Set-Attr $result.stat "exists" $FALSE;
}
-If (($get_checksum -or $get_md5) -and $result.stat.exists -and -not $result.stat.isdir)
+# only check get_checksum- it either got its value from get_md5 or was set directly.
+If (($get_checksum) -and $result.stat.exists -and -not $result.stat.isdir)
{
$hash = Get-FileChecksum($path);
Set-Attr $result.stat "md5" $hash;