Commit aa6e204b by Brian Coca

Merge pull request #11115 from jhawkesworth/second_go_at_fixing_1404

Part fix for https://github.com/ansible/ansible-modules-core/issues/1404 (replaces #11086)
parents 40553fb4 30b92a6f
...@@ -151,7 +151,7 @@ Function Get-FileMd5($path) ...@@ -151,7 +151,7 @@ Function Get-FileMd5($path)
{ {
$sp = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider; $sp = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider;
$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.BitConverter]::ToString($sp.ComputeHash($fp)).Replace("-", "").ToLower(); $hash = [System.BitConverter]::ToString($sp.ComputeHash($fp)).Replace("-", "").ToLower();
$fp.Dispose(); $fp.Dispose();
} }
ElseIf (Test-Path -PathType Container $path) ElseIf (Test-Path -PathType Container $path)
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
- name: verify that the file checksum is correct - name: verify that the file checksum is correct
assert: assert:
that: that:
- "copy_result.checksum[0] == 'c79a6506c1c948be0d456ab5104d5e753ab2f3e6'" - "copy_result.checksum == 'c79a6506c1c948be0d456ab5104d5e753ab2f3e6'"
- name: check the stat results of the file - name: check the stat results of the file
win_stat: path={{output_file}} win_stat: path={{output_file}}
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
# - "stat_results.stat.isfifo == false" # - "stat_results.stat.isfifo == false"
# - "stat_results.stat.isreg == true" # - "stat_results.stat.isreg == true"
# - "stat_results.stat.issock == false" # - "stat_results.stat.issock == false"
- "stat_results.stat.checksum[0] == 'c79a6506c1c948be0d456ab5104d5e753ab2f3e6'" - "stat_results.stat.checksum == 'c79a6506c1c948be0d456ab5104d5e753ab2f3e6'"
- name: overwrite the file via same means - name: overwrite the file via same means
win_copy: src=foo.txt dest={{output_file}} win_copy: src=foo.txt dest={{output_file}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment