TT#7211 fix repoapi.utils.dlfile, it was storing gzip responses content

All files were stored as gzip, since that is what nginx was sending

Change-Id: Ic999deaa2a073364db49eb5534e103b25d23704c
pull/3/head
Victor Seva 6 years ago
parent 34221aee0a
commit 4780f82908
No known key found for this signature in database
GPG Key ID: B1589889727198E0

@ -15,7 +15,6 @@
import logging
import os
import re
import shutil
import subprocess
from distutils.dir_util import mkpath
@ -59,9 +58,10 @@ def dlfile(url, path):
settings.JENKINS_HTTP_USER, settings.JENKINS_HTTP_PASSWD
)
logger.debug("url:[%s]", url)
with requests.get(url, auth=auth, stream=True) as req:
with open(path, "wb") as local_file:
shutil.copyfileobj(req.raw, local_file)
req = requests.get(url, auth=auth)
with open(path, "wb") as local_file:
for chunk in req.iter_content(chunk_size=128):
local_file.write(chunk)
def open_jenkins_url(url):

Loading…
Cancel
Save