Skip to content

Commit

Permalink
Add status_code & failed:false when status==200
Browse files Browse the repository at this point in the history
  • Loading branch information
bjolivot committed Feb 15, 2017
1 parent 86ed4b1 commit 8a55c91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ansible/modules/network/basics/get_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ def main():

res_args = dict(
url = url, dest = dest, src = tmpsrc, md5sum = md5sum, checksum_src = checksum_src,
checksum_dest = checksum_dest, changed = changed, msg = info.get('msg', '')
checksum_dest = checksum_dest, changed = changed, msg = info.get('msg', ''), status_code=info.get('status',''), failed=False

This comment has been minimized.

Copy link
@fabianstern1

fabianstern1 Nov 9, 2023

I came from kubespray project that uses ansible to download files using get_url. The problem here is ansible documentation states status_code is a) always returned and b) returns an int. Unfortunately the default value here is null, so the scripts fail. It should return -1 in case there is no status code ? Maybe also info['status'] is better here (as above usage shows)

)
if backup_file:
res_args['backup_file'] = backup_file
Expand Down

0 comments on commit 8a55c91

Please sign in to comment.