From: Bengt Thuree Date: Fri, 18 Jan 2019 18:28:17 +0000 (+1100) Subject: Fix corrupted zip/image upload X-Git-Tag: v0.20.0~10 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=7bbb7dc1e3a75ba2461a92de24022a8469732595;p=releng%2Flftools.git Fix corrupted zip/image upload Change the parameter to requests.posts from files=files, where files contained the file reference, to data=file.read(). This was done, since with the previous configuration binary files were corrupted during upload. Change-Id: I85c68adc32e031c7f1f101e9d8bfcb5a7acb0670 Issue-Id: RELENG-1591 Signed-off-by: Bengt Thuree --- diff --git a/lftools/deploy.py b/lftools/deploy.py index fe666633..51bba1b9 100644 --- a/lftools/deploy.py +++ b/lftools/deploy.py @@ -110,7 +110,7 @@ def _request_post_file(url, file_to_upload, parameters=None): if parameters: resp = requests.post(url, data=parameters, files=files) else: - resp = requests.post(url, files=files) + resp = requests.post(url, data=upload_file.read()) except requests.exceptions.MissingSchema: raise requests.HTTPError("Not valid URL: {}".format(url)) except requests.exceptions.ConnectionError: