mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Merge pull request #21677 from aneeshusa/check-http-response-status-2014.7
Check response status when using fileclient.get_url.
This commit is contained in:
commit
0fc61de0e2
@ -591,6 +591,7 @@ class Client(object):
|
||||
else:
|
||||
get_kwargs['stream'] = True
|
||||
response = requests.get(fixed_url, **get_kwargs)
|
||||
response.raise_for_status()
|
||||
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