From ab7fe884d7771e5c4d2d9a5f0c055311a73316a9 Mon Sep 17 00:00:00 2001
From: afunix
Date: Thu, 8 Sep 2016 22:23:54 +0300
Subject: [PATCH] Updated get_url module to process FTP results correctly
[#3661] (#4601)
---
network/basics/get_url.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/network/basics/get_url.py b/network/basics/get_url.py
index f2cc7c615c1..3ec59c2b08c 100644
--- a/network/basics/get_url.py
+++ b/network/basics/get_url.py
@@ -228,7 +228,7 @@ def url_get(module, url, dest, use_proxy, last_mod_time, force, timeout=10, head
module.exit_json(url=url, dest=dest, changed=False, msg=info.get('msg', ''))
# create a temporary file and copy content to do checksum-based replacement
- if info['status'] != 200 and not url.startswith('file:/'):
+ if info['status'] != 200 and not url.startswith('file:/') and not (url.startswith('ftp:/') and info.get('msg', '').startswith('OK')):
module.fail_json(msg="Request failed", status_code=info['status'], response=info['msg'], url=url, dest=dest)
if tmp_dest != '':