summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2015-01-26 21:44:42 -0800
committerJames Cammarata <jimi@sngx.net>2015-02-17 14:02:02 -0600
commit1771413c23dfe79c87d4387018cfff64233d8dad (patch)
treed26f0b8f1991946cdedb5e8770782b182f4e78ed
parentac0de5a9db56ac01c1f5261897cff2f139314d15 (diff)
downloadansible-1771413c23dfe79c87d4387018cfff64233d8dad.tar.gz
Make py2.4 remote checksum large-file-enabled as well
Conflicts: v2/ansible/plugins/shell/sh.py
-rw-r--r--lib/ansible/runner/shell_plugins/sh.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ansible/runner/shell_plugins/sh.py b/lib/ansible/runner/shell_plugins/sh.py
index ce21458852..5462429743 100644
--- a/lib/ansible/runner/shell_plugins/sh.py
+++ b/lib/ansible/runner/shell_plugins/sh.py
@@ -99,7 +99,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();\nafile = open(\"%s\", \"rb\")\nbuf = afile.read(BLOCKSIZE)\nwhile len(buf) > 0:\n\thasher.update(buf)\n\tbuf = afile.read(BLOCKSIZE)\nafile.close()\nprint(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
+ "(%s -c 'import sha; BLOCKSIZE = 65536; hasher = sha.sha1();\nafile = open(\"%s\", \"rb\")\nbuf = afile.read(BLOCKSIZE)\nwhile len(buf) > 0:\n\thasher.update(buf)\n\tbuf = afile.read(BLOCKSIZE)\nafile.close()\nprint(hasher.hexdigest())' 2>/dev/null)" % (python_interp, path), # Python == 2.4
]
cmd = " || ".join(csums)