mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
further md5 fixes
This commit is contained in:
parent
921bf3da9d
commit
19b43cd454
2 changed files with 10 additions and 2 deletions
|
@ -746,7 +746,8 @@ class Runner(object):
|
|||
test = "[[ -r %s ]]" % path
|
||||
md5s = [
|
||||
"(%s && /usr/bin/md5sum %s 2>/dev/null)" % (test,path),
|
||||
"(%s && /sbin/md5sum -q %s 2>/dev/null)" % (test,path)
|
||||
"(%s && /sbin/md5sum -q %s 2>/dev/null)" % (test,path),
|
||||
"(%s && /usr/bin/digest -a md5 -v %s 2>/dev/null)" % (test,path)
|
||||
]
|
||||
cmd = " || ".join(md5s)
|
||||
cmd = "%s || (echo \"0 %s\")" % (cmd, path)
|
||||
|
|
|
@ -314,7 +314,14 @@ def parse_kv(args):
|
|||
|
||||
def local_md5(file):
|
||||
''' compute local md5sum, return None if file is not present '''
|
||||
cmd = "/usr/bin/md5sum %s 2> /dev/null || /sbin/md5 -q %s" % (file,file)
|
||||
#was >>> cmd = "/usr/bin/md5sum %s 2> /dev/null || /sbin/md5 -q %s" % (file,file)
|
||||
md5s = [
|
||||
"(/usr/bin/md5sum %s 2>/dev/null)" % (file),
|
||||
"(/sbin/md5sum -q %s 2>/dev/null)" % (file),
|
||||
"(/usr/bin/digest -a md5 -v %s 2>/dev/null)" % (file)
|
||||
]
|
||||
cmd = " || ".join(md5s)
|
||||
|
||||
if not os.path.exists(file):
|
||||
return None
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue