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
6f5d18a2
Commit
6f5d18a2
authored
Jan 26, 2015
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10087 from axos88/devel
fix checksum calculation for large files
parents
c8ed12a6
03fa421f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
lib/ansible/runner/shell_plugins/sh.py
+1
-1
v2/ansible/plugins/shell/sh.py
+1
-1
No files found.
lib/ansible/runner/shell_plugins/sh.py
View file @
6f5d18a2
...
...
@@ -98,7 +98,7 @@ class ShellModule(object):
test
=
"rc=flag; [ -r
\'
%(p)
s
\'
] || rc=2; [ -f
\'
%(p)
s
\'
] || rc=1; [ -d
\'
%(p)
s
\'
] && rc=3;
%(i)
s -V 2>/dev/null || rc=4; [ x
\"
$rc
\"
!=
\"
xflag
\"
] && echo
\"
${rc}
\"\'
%(p)
s
\'
&& exit 0"
%
dict
(
p
=
path
,
i
=
python_interp
)
csums
=
[
"(
%
s -c 'import hashlib;
print(hashlib.sha1(open(
\"
%
s
\"
,
\"
rb
\"
).read())
.hexdigest())' 2>/dev/null)"
%
(
python_interp
,
path
),
# Python > 2.4 (including python3)
"(
%
s -c 'import hashlib;
BLOCKSIZE = 65536; hasher = hashlib.sha1();
\n
afile = open(
\"
%
s
\"
,
\"
rb
\"
)
\n
buf = afile.read(BLOCKSIZE)
\n
while len(buf) > 0:
\n\t
hasher.update(buf)
\n\t
buf = afile.read(BLOCKSIZE)
\n
afile.close()
\n
print(hasher
.hexdigest())' 2>/dev/null)"
%
(
python_interp
,
path
),
# Python > 2.4 (including python3)
"(
%
s -c 'import sha; print(sha.sha(open(
\"
%
s
\"
,
\"
rb
\"
).read()).hexdigest())' 2>/dev/null)"
%
(
python_interp
,
path
),
# Python == 2.4
]
...
...
v2/ansible/plugins/shell/sh.py
View file @
6f5d18a2
...
...
@@ -98,7 +98,7 @@ class ShellModule(object):
test
=
"rc=flag; [ -r
\'
%(p)
s
\'
] || rc=2; [ -f
\'
%(p)
s
\'
] || rc=1; [ -d
\'
%(p)
s
\'
] && rc=3;
%(i)
s -V 2>/dev/null || rc=4; [ x
\"
$rc
\"
!=
\"
xflag
\"
] && echo
\"
${rc}
\"\'
%(p)
s
\'
&& exit 0"
%
dict
(
p
=
path
,
i
=
python_interp
)
csums
=
[
"(
%
s -c 'import hashlib;
print(hashlib.sha1(open(
\"
%
s
\"
,
\"
rb
\"
).read())
.hexdigest())' 2>/dev/null)"
%
(
python_interp
,
path
),
# Python > 2.4 (including python3)
"(
%
s -c 'import hashlib;
BLOCKSIZE = 65536; hasher = hashlib.sha1();
\n
afile = open(
\"
%
s
\"
,
\"
rb
\"
)
\n
buf = afile.read(BLOCKSIZE)
\n
while len(buf) > 0:
\n\t
hasher.update(buf)
\n\t
buf = afile.read(BLOCKSIZE)
\n
afile.close()
\n
print(hasher
.hexdigest())' 2>/dev/null)"
%
(
python_interp
,
path
),
# Python > 2.4 (including python3)
"(
%
s -c 'import sha; print(sha.sha(open(
\"
%
s
\"
,
\"
rb
\"
).read()).hexdigest())' 2>/dev/null)"
%
(
python_interp
,
path
),
# Python == 2.4
]
...
...
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