From f07e3d297f1cde26ecb1b5a8399bff63d3d2b522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Matu=C5=A1ka?= Date: Mon, 12 Sep 2016 07:45:46 +0200 Subject: [PATCH] Force download if checksums do not match (#4262) --- network/basics/get_url.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/network/basics/get_url.py b/network/basics/get_url.py index 3ec59c2b08c..54bcedff05f 100644 --- a/network/basics/get_url.py +++ b/network/basics/get_url.py @@ -365,6 +365,11 @@ def main(): mtime = os.path.getmtime(dest) last_mod_time = datetime.datetime.utcfromtimestamp(mtime) + # If the checksum does not match we have to force the download + # because last_mod_time may be newer than on remote + if checksum_mismatch: + force = True + # download to tmpsrc tmpsrc, info = url_get(module, url, dest, use_proxy, last_mod_time, force, timeout, headers, tmp_dest)