Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
93415875
Commit
93415875
authored
Sep 30, 2013
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sha256sum-updates' of
https://github.com/jlund/ansible
into jlund-sha256sum-updates
parents
12a21d94
20489f13
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
library/network/get_url
+10
-2
No files found.
library/network/get_url
View file @
93415875
...
...
@@ -22,6 +22,7 @@
import
shutil
import
datetime
import
re
import
tempfile
DOCUMENTATION
=
'''
...
...
@@ -295,12 +296,19 @@ def main():
# Check the digest of the destination file and ensure that it matches the
# sha256sum parameter if it is present
if
sha256sum
!=
''
:
# Remove any non-alphanumeric characters, including the infamous
# Unicode zero-width space
stripped_sha256sum
=
re
.
sub
(
r'\W+'
,
''
,
sha256sum
)
if
not
HAS_HASHLIB
:
os
.
remove
(
dest
)
module
.
fail_json
(
msg
=
"The sha256sum parameter requires hashlib, which is available in Python 2.5 and higher"
)
if
sha256sum
!=
module
.
sha256
(
dest
):
else
:
destination_checksum
=
module
.
sha256
(
dest
)
if
stripped_sha256sum
!=
destination_checksum
:
os
.
remove
(
dest
)
module
.
fail_json
(
msg
=
"The SHA-256 checksum for
%
s did not match
%
s
"
%
(
dest
,
sha256
sum
))
module
.
fail_json
(
msg
=
"The SHA-256 checksum for
%
s did not match
%
s
; it was
%
s."
%
(
dest
,
sha256sum
,
destination_check
sum
))
os
.
remove
(
tmpsrc
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment