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:
Thomas S Hatch 2015-03-16 12:35:46 -06:00
commit 0fc61de0e2

View File

@ -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)