1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Added IndexError catch for copy module, IndexError is thrown if a destination file doesn't exist

This commit is contained in:
Jeremy Smitherman 2012-07-03 14:12:19 -04:00
parent e0a1c5be42
commit 3003aa2d47

View file

@ -84,7 +84,11 @@ md5sum_src = None
md5sum_src = md5_sum(src)
md5sum_dest = None
md5sum_dest = md5_sum(dest)
try:
md5sum_dest = md5_sum(dest)
except IndexError:
# File doesn't exist yet, so clear to continue
pass
if md5sum_src != md5sum_dest:
os.system("cp %s %s" % (src, dest))