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
8150b14d
Commit
8150b14d
authored
Jan 25, 2015
by
Akos Vandra
Committed by
James Cammarata
Feb 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes #10086
Conflicts: v2/ansible/plugins/shell/sh.py
parent
f32e9f0e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
1 deletions
+1
-1
lib/ansible/runner/shell_plugins/sh.py
+1
-1
No files found.
lib/ansible/runner/shell_plugins/sh.py
View file @
8150b14d
...
...
@@ -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
with open(
\"
%
s
\"
,
\"
rb
\"
) as afile:
\n\t
buf = afile.read(BLOCKSIZE)
\n\t
while len(buf) > 0:
\n\t\t
hasher.update(buf)
\n\t\t
buf = afile.read(BLOCKSIZE)
\n\n\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