summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornitzmahone <mdavis@ansible.com>2016-02-29 16:30:55 -0800
committerJames Cammarata <jimi@sngx.net>2016-03-21 12:54:35 -0400
commita74e97fa31f8dd4a4e84740fae5d26aa822e170b (patch)
treec1262dd78c647cf832c7a10bfc30da093b32e702
parent3a91a4321ead47a6ddc0f2ead3a55cfdace13fd5 (diff)
downloadansible-a74e97fa31f8dd4a4e84740fae5d26aa822e170b.tar.gz
don't lock file when calculating checksum
-rw-r--r--lib/ansible/module_utils/powershell.ps12
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ansible/module_utils/powershell.ps1 b/lib/ansible/module_utils/powershell.ps1
index c150b07744..fc1d49f4ed 100644
--- a/lib/ansible/module_utils/powershell.ps1
+++ b/lib/ansible/module_utils/powershell.ps1
@@ -211,7 +211,7 @@ Function Get-FileChecksum($path)
If (Test-Path -PathType Leaf $path)
{
$sp = new-object -TypeName System.Security.Cryptography.SHA1CryptoServiceProvider;
- $fp = [System.IO.File]::Open($path, [System.IO.Filemode]::Open, [System.IO.FileAccess]::Read);
+ $fp = [System.IO.File]::Open($path, [System.IO.Filemode]::Open, [System.IO.FileAccess]::Read, [System.IO.FileShare]::ReadWrite);
$hash = [System.BitConverter]::ToString($sp.ComputeHash($fp)).Replace("-", "").ToLower();
$fp.Dispose();
}