fetch module fails - Mac OS X

Hi :

  Looks like the fetch module is using md5sum tool and Mac OS X the
tool is md5.
For Quick fix: I created a symlink for md5 as md5sum.

Kumars-MacBook-Pro:ansible kumarkandasami$ ls -l /sbin/md*
-r-xr-xr-x 1 root wheel 65344 Jul 11 2011 /sbin/md5
lrwxr-xr-x 1 root wheel 9 Jun 4 14:39 /sbin/md5sum -> /sbin/
md5

However, the task fails that "md5 mismatch" - eventhough the checksum
are the same on the remote and local file.

On Mac machine:
MD5 (/tmp/xyz.tar) = 2a04e580f1bbacd3dfaf34c0bfebdc56

On Remote (Rhel) machine:
2a04e580f1bbacd3dfaf34c0bfebdc56 xyz.tar

Obviously, the code is using the split() command that will fail on the
Mac machine as the output format of the Mac OS X is different.

Is there a solution or workaround for this problem ?

P.S. Mac OS X = 10.7.3

Thanks,

Someone would have to make the md5 parser function smart and look in two places for md5/sum, which I thought we already did. Super easy patch... How about giving it a shot?

-- Michael

How about some nice portable Python? Not sure if there’s already a module on the remote side in every case (or how you feel about python -c ;), but this actually comes out faster than md5sum on my box:

#!/usr/bin/env python

import sys
from hashlib import md5
from binascii import hexlify

BLOCKSIZE=64*1024

f = open(sys.argv[1], ‘rb’)
hash = md5()

block = f.read(BLOCKSIZE)
while block:
hash.update(block)
block = f.read(BLOCKSIZE)

print hexlify(hash.digest())

No.

– Michael