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
03fa421f
Commit
03fa421f
authored
Jan 25, 2015
by
Akos Vandra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not use with, it is not supported all the way down to 2.4
parent
e8144b3b
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 @
03fa421f
...
...
@@ -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; 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 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 @
03fa421f
...
...
@@ -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; 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 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