mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Merge pull request #17247 from rallytime/bp-17188
Backport #17188 to 2014.7
This commit is contained in:
commit
1845145c19
@ -590,7 +590,12 @@ class Client(object):
|
||||
else:
|
||||
fixed_url = url
|
||||
try:
|
||||
response = requests.get(fixed_url, stream=True)
|
||||
if requests.__version__[0] == '0':
|
||||
# 'stream' was called 'prefetch' before 1.0, with flipped meaning
|
||||
get_kwargs = {'prefetch': False}
|
||||
else:
|
||||
get_kwargs = {'stream': True}
|
||||
response = requests.get(fixed_url, **get_kwargs)
|
||||
with salt.utils.fopen(dest, 'wb') as destfp:
|
||||
for chunk in response.iter_content(chunk_size=32*1024):
|
||||
destfp.write(chunk)
|
||||
|
Loading…
Reference in New Issue
Block a user