From d7c1bb2fc657c09e9268e128afe8744ce4e4808e Mon Sep 17 00:00:00 2001 From: Mariusz Mazur Date: Tue, 19 Mar 2019 17:06:21 +0100 Subject: [PATCH] kubevirt_cdi_upload: fix the upload (#54048) --- lib/ansible/modules/cloud/kubevirt/kubevirt_cdi_upload.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/kubevirt/kubevirt_cdi_upload.py b/lib/ansible/modules/cloud/kubevirt/kubevirt_cdi_upload.py index 79edb92776..526de90a35 100644 --- a/lib/ansible/modules/cloud/kubevirt/kubevirt_cdi_upload.py +++ b/lib/ansible/modules/cloud/kubevirt/kubevirt_cdi_upload.py @@ -158,9 +158,8 @@ class KubeVirtCDIUpload(KubernetesRawModule): result = self.perform_action(resource, definition) headers = {'Authorization': "Bearer {0}".format(result['result']['status']['token'])} - files = {'file': imgfile} url = "{0}/{1}/upload".format(upload_host, API) - requests.post(url, files=files, headers=headers, verify=upload_host_verify_ssl) + requests.post(url, data=imgfile, headers=headers, verify=upload_host_verify_ssl) self.exit_json(changed=True)